gke.go 440 B

123456789101112131415161718192021222324
  1. package input
  2. import (
  3. "encoding/json"
  4. )
  5. type GKE struct {
  6. GCPCredentials string `json:"gcp_credentials"`
  7. GCPRegion string `json:"gcp_region"`
  8. GCPProjectID string `json:"gcp_project_id"`
  9. ClusterName string `json:"cluster_name"`
  10. }
  11. func (gke *GKE) GetInput() ([]byte, error) {
  12. return json.Marshal(gke)
  13. }
  14. func GetGKEInput(bytes []byte) (*GKE, error) {
  15. res := &GKE{}
  16. err := json.Unmarshal(bytes, res)
  17. return res, err
  18. }