Documentation
¶
Index ¶
- type API
- func (api *API) Create(ctx context.Context, requester interface{}, request *CreateRequest) (*hook.Hook, error)
- func (api *API) Delete(ctx context.Context, requester interface{}, request *DeleteRequest) (uuid.UUID, error)
- func (api *API) Get(ctx context.Context, requester interface{}, request *GetRequest) (*hook.Hook, error)
- func (api *API) List(ctx context.Context, requester interface{}, request *ListRequest) (*ListResponse, error)
- func (api *API) Update(ctx context.Context, requester interface{}, request *UpdateRequest) (*hook.Hook, error)
- type CreateRequest
- type DeleteRequest
- type GetRequest
- type ListRequest
- type ListResponse
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(ctrl *controller.Controller, rt *runtime.Runtime) *API
func (*API) List ¶
func (api *API) List(ctx context.Context, requester interface{}, request *ListRequest) (*ListResponse, error)
type CreateRequest ¶
type CreateRequest struct {
EventType hook.EventType `json:"event_type"`
AgentName string `json:"agent_name"` // empty = wildcard
Command string `json:"command"`
Args []string `json:"args"`
Enabled bool `json:"enabled"`
}
func (CreateRequest) Validate ¶
func (r CreateRequest) Validate() error
type DeleteRequest ¶
func (DeleteRequest) Validate ¶
func (r DeleteRequest) Validate() error
type GetRequest ¶
func (GetRequest) Validate ¶
func (r GetRequest) Validate() error
type ListRequest ¶
type ListRequest struct {
pagination.CursorRequest
// Optional filters
EventType *hook.EventType `json:"event_type,omitempty"`
AgentName *string `json:"agent_name,omitempty"`
Search string `json:"search"` // ILIKE on agent_name/command
}
func (*ListRequest) Validate ¶
func (r *ListRequest) Validate() error
type ListResponse ¶
type ListResponse struct {
pagination.CursorResponse
Hooks []hook.Hook `json:"hooks"`
}
type UpdateRequest ¶
type UpdateRequest struct {
HookID uuid.UUID `json:"hook_id"`
EventType *hook.EventType `json:"event_type,omitempty"`
AgentName *string `json:"agent_name,omitempty"`
Command *string `json:"command,omitempty"`
Args *[]string `json:"args,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
func (UpdateRequest) Validate ¶
func (r UpdateRequest) Validate() error
Click to show internal directories.
Click to hide internal directories.