Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Ctl is a global webhook controller instance Ctl = NewController() )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // CreatePolicy creates webhook policy CreatePolicy(ctx context.Context, policy *model.Policy) (int64, error) // ListPolicies lists webhook policies filter by query ListPolicies(ctx context.Context, query *q.Query) ([]*model.Policy, error) // CountPolicies counts webhook policies filter by query CountPolicies(ctx context.Context, query *q.Query) (int64, error) // GetPolicy gets webhook policy by specified ID GetPolicy(ctx context.Context, id int64) (*model.Policy, error) // UpdatePolicy updates webhook policy UpdatePolicy(ctx context.Context, policy *model.Policy) error // DeletePolicy deletes webhook policy by specified ID DeletePolicy(ctx context.Context, policyID int64) error // GetRelatedPolices gets related policies by the input project id and event type GetRelatedPolices(ctx context.Context, projectID int64, eventType string) ([]*model.Policy, error) // CountExecutions counts executions under the webhook policy CountExecutions(ctx context.Context, policyID int64, query *q.Query) (int64, error) // ListExecutions lists executions under the webhook policy ListExecutions(ctx context.Context, policyID int64, query *q.Query) ([]*task.Execution, error) // CountTasks counts tasks under the webhook execution CountTasks(ctx context.Context, execID int64, query *q.Query) (int64, error) // ListTasks lists tasks under the webhook execution ListTasks(ctx context.Context, execID int64, query *q.Query) ([]*task.Task, error) // GetTask gets the webhook task by the specified ID GetTask(ctx context.Context, taskID int64) (*task.Task, error) // GetTaskLog gets task log GetTaskLog(ctx context.Context, taskID int64) ([]byte, error) // GetLastTriggerTime gets policy last trigger time group by event type GetLastTriggerTime(ctx context.Context, eventType string, policyID int64) (time.Time, error) }
func NewController ¶
func NewController() Controller
Click to show internal directories.
Click to hide internal directories.