Documentation ¶
Index ¶
- Constants
- Variables
- func FormatHookOutputPath(runID, hookRunID string) string
- func FormatRunManifestOutputPath(runID string) string
- func NewHookRunID(actionIdx, hookIdx int) string
- type Action
- type ActionHook
- type ActionOn
- type Airflow
- type DBRunResultIterator
- type DBTaskResultIterator
- type DagRunReq
- type EventInfo
- type Hook
- type HookBase
- type HookOutputWriter
- type HookType
- type MatchSpec
- type NewHookFunc
- type OnEvents
- type OutputWriter
- type Properties
- type RunManifest
- type RunResult
- type RunResultIterator
- type SecureString
- type Service
- func (s *Service) GetRunResult(ctx context.Context, repositoryID string, runID string) (*RunResult, error)
- func (s *Service) GetTaskResult(ctx context.Context, repositoryID string, runID string, hookRunID string) (*TaskResult, error)
- func (s *Service) ListRunResults(ctx context.Context, repositoryID string, branchID, commitID string, ...) (RunResultIterator, error)
- func (s *Service) ListRunTaskResults(ctx context.Context, repositoryID string, runID string, after string) (TaskResultIterator, error)
- func (s *Service) PostCommitHook(ctx context.Context, record graveler.HookRecord) error
- func (s *Service) PostMergeHook(ctx context.Context, record graveler.HookRecord) error
- func (s *Service) PreCommitHook(ctx context.Context, record graveler.HookRecord) error
- func (s *Service) PreMergeHook(ctx context.Context, record graveler.HookRecord) error
- func (s *Service) Run(ctx context.Context, record graveler.HookRecord) error
- func (s *Service) Stop()
- func (s *Service) UpdateCommitID(ctx context.Context, repositoryID string, storageNamespace string, ...) error
- type Source
- type Task
- type TaskResult
- type TaskResultIterator
- type Webhook
Constants ¶
View Source
const ( LogOutputExtension = ".log" LogOutputLocation = "_lakefs/actions/log" )
View Source
const (
HeadersPropertyKey = "headers"
)
Variables ¶
View Source
var ( ErrInvalidAction = errors.New("invalid action") ErrInvalidEventType = errors.New("invalid event type") )
View Source
var ErrIteratorClosed = errors.New("iterator closed")
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrUnknownHookType = errors.New("unknown hook type")
Functions ¶
func FormatHookOutputPath ¶
func NewHookRunID ¶
Types ¶
type Action ¶
type Action struct { Name string `yaml:"name"` Description string `yaml:"description"` On OnEvents `yaml:"on"` Hooks []ActionHook `yaml:"hooks"` }
func LoadActions ¶
func ParseAction ¶
ParseAction helper function to read, parse and validate Action from a reader
type ActionHook ¶
type ActionHook struct { ID string `yaml:"id"` Type HookType `yaml:"type"` Description string `yaml:"description"` Properties Properties `yaml:"properties"` }
type Airflow ¶ added in v0.47.0
type Airflow struct { HookBase URL string DagID string Username string Password SecureString DAGConf map[string]interface{} }
func (*Airflow) Run ¶ added in v0.47.0
func (a *Airflow) Run(ctx context.Context, record graveler.HookRecord, writer *HookOutputWriter) error
type DBRunResultIterator ¶
type DBRunResultIterator struct {
// contains filtered or unexported fields
}
func NewDBRunResultIterator ¶
func (*DBRunResultIterator) Close ¶
func (it *DBRunResultIterator) Close()
func (*DBRunResultIterator) Err ¶
func (it *DBRunResultIterator) Err() error
func (*DBRunResultIterator) Next ¶
func (it *DBRunResultIterator) Next() bool
func (*DBRunResultIterator) Value ¶
func (it *DBRunResultIterator) Value() *RunResult
type DBTaskResultIterator ¶
type DBTaskResultIterator struct {
// contains filtered or unexported fields
}
func NewDBTaskResultIterator ¶
func (*DBTaskResultIterator) Close ¶
func (it *DBTaskResultIterator) Close()
func (*DBTaskResultIterator) Err ¶
func (it *DBTaskResultIterator) Err() error
func (*DBTaskResultIterator) Next ¶
func (it *DBTaskResultIterator) Next() bool
func (*DBTaskResultIterator) Value ¶
func (it *DBTaskResultIterator) Value() *TaskResult
type EventInfo ¶ added in v0.47.0
type EventInfo 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,omitempty"` CommitMessage string `json:"commit_message"` Committer string `json:"committer"` CommitMetadata map[string]string `json:"commit_metadata,omitempty"` }
type Hook ¶
type Hook interface {
Run(ctx context.Context, record graveler.HookRecord, writer *HookOutputWriter) error
}
Hook is the abstraction of the basic user-configured runnable building-stone
func NewAirflowHook ¶ added in v0.47.0
func NewAirflowHook(h ActionHook, action *Action) (Hook, error)
func NewWebhook ¶
func NewWebhook(h ActionHook, action *Action) (Hook, error)
type HookOutputWriter ¶
type HookOutputWriter struct { StorageNamespace string RunID string HookRunID string ActionName string HookID string Writer OutputWriter }
func (*HookOutputWriter) OutputWrite ¶
type NewHookFunc ¶
type NewHookFunc func(ActionHook, *Action) (Hook, error)
type OutputWriter ¶
type Properties ¶ added in v0.47.0
type Properties map[string]interface{}
type RunManifest ¶
type RunManifest struct { Run RunResult `json:"run"` HooksRun []TaskResult `json:"hooks,omitempty"` }
type RunResult ¶
type RunResult struct { RunID string `db:"run_id" json:"run_id"` BranchID string `db:"branch_id" json:"branch_id"` SourceRef string `db:"source_ref" json:"source_ref"` EventType string `db:"event_type" json:"event_type"` StartTime time.Time `db:"start_time" json:"start_time"` EndTime time.Time `db:"end_time" json:"end_time"` Passed bool `db:"passed" json:"passed"` CommitID string `db:"commit_id" json:"commit_id,omitempty"` }
type RunResultIterator ¶
type SecureString ¶ added in v0.48.0
type SecureString struct {
// contains filtered or unexported fields
}
SecureString is a string that may be populated from an environment variable. If constructed with a string of the form {{ ENV.EXAMPLE_VARIABLE }}, the value is populated from EXAMPLE_VARIABLE and is considered a secret. Otherwise the value is taken from the string as-is, and is not considered a secret.
func NewSecureString ¶ added in v0.48.0
func NewSecureString(s string) (SecureString, error)
Creates a new SecureString, reading env var if needed.
func (SecureString) String ¶ added in v0.48.0
func (s SecureString) String() string
Returns the string for non-secrets, or asterisks otherwise.
type Service ¶
type Service struct { DB db.Database Source Source Writer OutputWriter // contains filtered or unexported fields }
func NewService ¶
func (*Service) GetRunResult ¶
func (*Service) GetTaskResult ¶
func (*Service) ListRunResults ¶
func (*Service) ListRunTaskResults ¶
func (*Service) PostCommitHook ¶
func (*Service) PostMergeHook ¶
func (*Service) PreCommitHook ¶
func (*Service) PreMergeHook ¶
type TaskResult ¶
type TaskResult struct { RunID string `db:"run_id" json:"run_id"` HookRunID string `db:"hook_run_id" json:"hook_run_id"` HookID string `db:"hook_id" json:"hook_id"` ActionName string `db:"action_name" json:"action_name"` StartTime time.Time `db:"start_time" json:"start_time"` EndTime time.Time `db:"end_time" json:"end_time"` Passed bool `db:"passed" json:"passed"` }
func (*TaskResult) LogPath ¶
func (r *TaskResult) LogPath() string
type TaskResultIterator ¶
type TaskResultIterator interface { Next() bool Value() *TaskResult Err() error Close() }
type Webhook ¶
type Webhook struct { HookBase URL string Timeout time.Duration QueryParams map[string][]SecureString Headers map[string]SecureString }
func (*Webhook) Run ¶
func (w *Webhook) Run(ctx context.Context, record graveler.HookRecord, writer *HookOutputWriter) (err error)
Click to show internal directories.
Click to hide internal directories.