Documentation ¶
Index ¶
- type Client
- func (c *Client) CheckLiveness() (bool, error)
- func (c *Client) CheckReadiness() (bool, error)
- func (c *Client) CheckStatus() (string, error)
- func (c *Client) CreateEvent(e *storage.Event) (string, error)
- func (c *Client) CreateEventReceiver(er *storage.EventReceiver) (string, error)
- func (c *Client) CreateEventReceiverGroup(erg *storage.EventReceiverGroup) (string, error)
- func (c *Client) DoDelete(endpoint string, payload []byte) (string, error)
- func (c *Client) DoGet(endpoint string) (string, error)
- func (c *Client) DoPatch(endpoint string, payload []byte) (string, error)
- func (c *Client) DoPost(endpoint string, payload []byte) (string, error)
- func (c *Client) DoPut(endpoint string, payload []byte) (string, error)
- func (c *Client) GetCurlSearch(operation string, params map[string]interface{}, fields []string) (string, error)
- func (c *Client) GetEndpoint(end string) (string, error)
- func (c *Client) ModifyEventReceiverGroup(erg *storage.EventReceiverGroup) (string, error)
- func (c *Client) Search(operation string, params map[string]interface{}, fields []string) (string, error)
- func (c *Client) SearchEventReceiverGroups(params map[string]interface{}, fields []string) ([]storage.EventReceiverGroup, error)
- func (c *Client) SearchEventReceivers(params map[string]interface{}, fields []string) ([]storage.EventReceiver, error)
- func (c *Client) SearchEvents(params map[string]interface{}, fields []string) ([]storage.Event, error)
- type Contract
- type GraphQLRequest
- type RespGraphQL
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a struct for EPR Client configuration
func New ¶
New returns a new instance of Client struct. Requires a URL to an instance of EPR. Use options functions for setting specific parameters.
func (*Client) CheckLiveness ¶
CheckLiveness checks the EPRs liveness
func (*Client) CheckReadiness ¶
CheckReadiness checks EPR readiness
func (*Client) CheckStatus ¶
CheckStatus checks the EPRs Status
func (*Client) CreateEvent ¶
CreateEvent used to create and Event
func (*Client) CreateEventReceiver ¶
func (c *Client) CreateEventReceiver(er *storage.EventReceiver) (string, error)
CreateEventReceiver used to create an EventReceiver
func (*Client) CreateEventReceiverGroup ¶
func (c *Client) CreateEventReceiverGroup(erg *storage.EventReceiverGroup) (string, error)
CreateEventReceiverGroup used to create an EventReceiverGroup
func (*Client) GetCurlSearch ¶
func (c *Client) GetCurlSearch(operation string, params map[string]interface{}, fields []string) (string, error)
GetCurlSearch
func (*Client) GetEndpoint ¶
GetEndpoint formats endoint url
func (*Client) ModifyEventReceiverGroup ¶
func (c *Client) ModifyEventReceiverGroup(erg *storage.EventReceiverGroup) (string, error)
ModifyEventReceiverGroup takes a EventReceiverGroup object and updates the "Disabled" field in the EPR based on the EventReceiverGroup ID. This function returns a JSON blob with the ID of the EventReceiverGroup it modified.
func (*Client) Search ¶
func (c *Client) Search(operation string, params map[string]interface{}, fields []string) (string, error)
Search searches for the given queryFor based on params
func (*Client) SearchEventReceiverGroups ¶
func (*Client) SearchEventReceivers ¶
type Contract ¶
type Contract interface { CreateEvent(e *storage.Event) (string, error) CreateEventReceiver(er *storage.EventReceiver) (string, error) CreateEventReceiverGroup(erg *storage.EventReceiverGroup) (string, error) ModifyEventReceiverGroup(erg *storage.EventReceiverGroup) (string, error) Search(operation string, params map[string]interface{}, fields []string) (string, error) SearchEvents(params map[string]interface{}, fields []string) ([]storage.Event, error) SearchEventReceivers(params map[string]interface{}, fields []string) ([]storage.EventReceiver, error) SearchEventReceiverGroups(params map[string]interface{}, fields []string) ([]storage.EventReceiverGroup, error) CheckReadiness() (bool, error) CheckLiveness() (bool, error) CheckStatus() (string, error) GetEndpoint(end string) (string, error) }
Contract handles communications with the EPR service
type GraphQLRequest ¶
type GraphQLRequest struct { Query string `json:"query"` Operation string `json:"operationName,omitempty"` Variables map[string]interface{} `json:"variables,omitempty"` }
GraphQLRequest struct for graphql request
func NewGraphQLMutationRequest ¶
func NewGraphQLMutationRequest(operation string, params map[string]interface{}) *GraphQLRequest
func NewGraphQLSearchRequest ¶
func NewGraphQLSearchRequest(operation string, params map[string]interface{}, fields []string) *GraphQLRequest
NewGraphQLSearchRequest creates a new GraphQLRequest operation can be events or event_receivers or event_receiver_groups
type RespGraphQL ¶
type RespGraphQL struct { Data struct { Events []storage.Event `json:"events,omitempty"` EventReceivers []storage.EventReceiver `json:"event_receivers,omitempty"` EventReceiverGroups []storage.EventReceiverGroup `json:"event_receiver_groups,omitempty"` CreateEvent graphql.ID `json:"create_event,omitempty"` CreateEventReceiver graphql.ID `json:"create_event_receiver,omitempty"` CreateEventReceiverGroup graphql.ID `json:"create_event_receiver_group,omitempty"` } `json:"data"` Errors interface{} `json:"errors,omitempty"` }
RespGraphQL type is a struct that represents the response data from a GraphQL query
func DecodeGraphQLRespFromJSON ¶
func DecodeGraphQLRespFromJSON(reader io.Reader) (*RespGraphQL, error)
The function `DecodeGraphQLRespFromJSON` decodes a JSON response into a `RespGraphQL` struct.