Documentation
¶
Index ¶
- Variables
- func FormatHookOutputPath(runID, actionName, hookID string) string
- func NewRunID(t time.Time) string
- type Action
- type ActionHook
- type ActionOn
- type Deps
- type Event
- type EventType
- type FileRef
- type Hook
- type HookOutputWriter
- type HookType
- type MatchSpec
- type NewHookFunc
- type OnEvents
- type OutputWriter
- type RunResult
- type RunResultIter
- type Service
- type Source
- type Task
- type TaskResult
- type TaskResultIter
- type Webhook
- type WebhookEventInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidAction = errors.New("invalid action") ErrInvalidEventType = errors.New("invalid event type") )
View Source
var ( ErrWebhookRequestFailed = errors.New("webhook request failed") ErrWebhookMissingURL = errors.New("webhook missing url") )
View Source
var (
ErrNotFound = errors.New("not found")
)
View Source
var ErrUnknownHookType = errors.New("unknown hook type")
Functions ¶
func FormatHookOutputPath ¶ added in v0.32.0
Types ¶
type Action ¶
type Action struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
On OnEvents `yaml:"on"`
Hooks []ActionHook `yaml:"hooks"`
}
func MatchedActions ¶ added in v0.32.0
func ParseAction ¶
ParseAction helper function to read, parse and validate Action from a reader
type ActionHook ¶
type Deps ¶ added in v0.32.0
type Deps struct {
Source Source
Output OutputWriter
}
type Hook ¶
type Hook interface {
Run(ctx context.Context, event Event, writer *HookOutputWriter) error
}
Hook is the abstraction of the basic user-configured runnable building-stone
func NewWebhook ¶
func NewWebhook(h ActionHook, action *Action) (Hook, error)
type HookOutputWriter ¶ added in v0.32.0
type HookOutputWriter struct {
RunID string
ActionName string
HookID string
Writer OutputWriter
}
func (*HookOutputWriter) OutputWrite ¶ added in v0.32.0
type NewHookFunc ¶
type NewHookFunc func(ActionHook, *Action) (Hook, error)
type OutputWriter ¶
type RunResultIter ¶ added in v0.32.0
type TaskResult ¶ added in v0.32.0
type TaskResultIter ¶ added in v0.32.0
type TaskResultIter interface {
Next() bool
Value() TaskResult
// SeekGE seeks by start-time
SeekGE(time.Time)
Err() error
Close()
}
type WebhookEventInfo ¶
type WebhookEventInfo struct {
EventType string `json:"event_type"`
EventTime string `json:"event_time"`
ActionName string `json:"action_name"`
HookID string `json:"hook_id"`
RepositoryID string `json:"repository_id"`
BranchID string `json:"branch_id"`
SourceRef string `json:"source_ref"`
CommitMessage string `json:"commit_message"`
Committer string `json:"committer"`
Metadata map[string]string `json:"metadata"`
}
Click to show internal directories.
Click to hide internal directories.