doks.go 383 B

1234567891011121314151617181920212223
  1. package input
  2. import (
  3. "encoding/json"
  4. )
  5. type DOKS struct {
  6. DORegion string `json:"do_region"`
  7. DOToken string `json:"do_token"`
  8. ClusterName string `json:"cluster_name"`
  9. }
  10. func (doks *DOKS) GetInput() ([]byte, error) {
  11. return json.Marshal(doks)
  12. }
  13. func GetDOKSInput(bytes []byte) (*DOKS, error) {
  14. res := &DOKS{}
  15. err := json.Unmarshal(bytes, res)
  16. return res, err
  17. }