diff --git a/internal/api/receive_file.go b/internal/api/receive_file.go index a2150d6..12425bf 100644 --- a/internal/api/receive_file.go +++ b/internal/api/receive_file.go @@ -11,6 +11,7 @@ import ( type Response struct { Port string `json:"port"` + ID string `json:"id"` } func GetServerInfo(id string) (string,error) { diff --git a/internal/api/send_file.go b/internal/api/send_file.go index c957158..3d8188c 100644 --- a/internal/api/send_file.go +++ b/internal/api/send_file.go @@ -2,6 +2,7 @@ package api import ( "bytes" + "encoding/json" "fmt" "io" "mime/multipart" @@ -12,7 +13,7 @@ import ( ) // type Response struct { -// pullID string `json:"id"` +// PullID string `json:"id"` // pullIDからPullIDへ変更して公開 // } // TODO: 取り敢えず書いてみただけなので、動作確認しつつ適宜変更してください。 @@ -61,12 +62,12 @@ func SendTarToServer(publishList []string, envList []string) error { } fmt.Println(string(responseBody.String())) - // var resp Response - // err = json.Unmarshal(responseBody.Bytes(), &resp) - // if err != nil { - // return err - // } - // fmt.Printf("Share this command!!!!\n") - // fmt.Printf("ketos pull -i %s\n", resp.pullID) + var resp Response + err = json.Unmarshal(responseBody.Bytes(), &resp) + if err != nil { + return err + } + fmt.Printf("\n\n\nShare this command!!!!\n") + fmt.Printf("ketos pull -i %s\n", resp.ID) // resp.pullIDからresp.PullIDへ変更 return nil }