Documentation ¶
Index ¶
- type Client
- type Data
- type GraphqlClient
- func (c *GraphqlClient) CreateHeartbeatMonitor(ctx context.Context, data *Data) (string, string, error)
- func (c *GraphqlClient) CreateIntegrationKey(ctx context.Context, data *Data) (string, error)
- func (c *GraphqlClient) CreateService(ctx context.Context, data *Data) (string, error)
- func (c *GraphqlClient) DeleteService(ctx context.Context, data *Data) error
- func (c *GraphqlClient) IsHeartbeatMonitorInactive(ctx context.Context, data *Data) (bool, error)
- func (c *GraphqlClient) NewRequest(ctx context.Context, method string, body interface{}) ([]byte, error)
- type Q
- type RespDelete
- type RespHeartBeatData
- type RespHeartbeatState
- type RespIntKeyData
- type RespSvcData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { CreateService(ctx context.Context, data *Data) (string, error) CreateIntegrationKey(ctx context.Context, data *Data) (string, error) CreateHeartbeatMonitor(ctx context.Context, data *Data) (string, string, error) DeleteService(ctx context.Context, data *Data) error NewRequest(ctx context.Context, method string, body interface{}) ([]byte, error) IsHeartbeatMonitorInactive(ctx context.Context, data *Data) (bool, error) }
Client is a wrapper interface for the GraphqlClient to allow for easier testing
type Data ¶
type Data struct { Name string `json:"name"` Id string `json:"id,omitempty"` Description string `json:"description,omitempty"` Favorite bool `json:"favorite,omitempty"` EscalationPolicyID string `json:"escalationPolicyID,omitempty"` Type string `json:"type,omitempty"` Timeout int `json:"timeoutMinutes,omitempty"` DeleteAll bool `json:"deleteAll,omitempty"` }
Data describes the data that is needed for Goalert GraphQL api calls
type GraphqlClient ¶
type GraphqlClient struct {
// contains filtered or unexported fields
}
Wrapper for HTTP client
func (*GraphqlClient) CreateHeartbeatMonitor ¶
func (c *GraphqlClient) CreateHeartbeatMonitor(ctx context.Context, data *Data) (string, string, error)
CreateHeartbeatMonitor calls GoAlert's GraphQL api to create a new heartbeat monitor for a GoAlert Service
func (*GraphqlClient) CreateIntegrationKey ¶
CreateIntegrationKey calls GoAlert's GraphQL api to create a new integration key
func (*GraphqlClient) CreateService ¶
CreateService calls GoAlert's GraphQL api to create a new service within GoAlert
func (*GraphqlClient) DeleteService ¶
func (c *GraphqlClient) DeleteService(ctx context.Context, data *Data) error
DeleteService calls GoAlert's GraphQL API to delete a GoAlert service
func (*GraphqlClient) IsHeartbeatMonitorInactive ¶
func (*GraphqlClient) NewRequest ¶
func (c *GraphqlClient) NewRequest(ctx context.Context, method string, body interface{}) ([]byte, error)
NewRequest is a wrapper func to help send the http request
type RespDelete ¶
type RespDelete struct { Data struct { DeleteAll bool `json:"deleteAll"` } `json:"data"` }
RespDelete contains boolean returned from deleteAll
type RespHeartBeatData ¶
type RespHeartBeatData struct { Data struct { CreateHeartBeatKey struct { Key string `json:"href"` Id string `json:"id"` } `json:"createHeartbeatMonitor"` } `json:"data"` }
RespHeartBeatData describes a heartbeat monitor key from createHeartbeatMonitor
type RespHeartbeatState ¶
type RespHeartbeatState struct { Data struct { Heatbeatmonitor struct { LastState string `json:"lastState"` } `json:"heartbeatMonitor"` } `json:"data"` }
type RespIntKeyData ¶
type RespIntKeyData struct { Data struct { CreateIntKey struct { Key string `json:"href"` } `json:"createIntegrationKey"` } `json:"data"` }
RespIntKeyData describes int key returned from createIntegrationKey
type RespSvcData ¶
type RespSvcData struct { Data struct { CreateService struct { ID string `json:"id"` } `json:"createService"` } `json:"data"` }
RespSvcData describes Svc ID returned from createService