gcr.go 395 B

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