hooks

package
v0.2.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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) Create

func (api *API) Create(ctx context.Context, requester interface{}, request *CreateRequest) (*hook.Hook, error)

func (*API) Delete

func (api *API) Delete(ctx context.Context, requester interface{}, request *DeleteRequest) (uuid.UUID, error)

func (*API) Get

func (api *API) Get(ctx context.Context, requester interface{}, request *GetRequest) (*hook.Hook, error)

func (*API) List

func (api *API) List(ctx context.Context, requester interface{}, request *ListRequest) (*ListResponse, error)

func (*API) Update

func (api *API) Update(ctx context.Context, requester interface{}, request *UpdateRequest) (*hook.Hook, 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

type DeleteRequest struct {
	HookID uuid.UUID `json:"hook_id"`
}

func (DeleteRequest) Validate

func (r DeleteRequest) Validate() error

type GetRequest

type GetRequest struct {
	HookID uuid.UUID `json:"hook_id"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL