Documentation
¶
Index ¶
- Constants
- Variables
- func APIKeyNameExists(conn pg.Conn, name string, scope Scope) (bool, error)
- func CheckConnectorName(v *ejson.Validator, token string, cname string) bool
- func CheckDescription(v *ejson.Validator, token string, label string)
- func CheckEventName(v *ejson.Validator, token string, cname, name string) bool
- func CheckEventRef(v *ejson.Validator, token string, ref EventRef) bool
- func CheckIdentityName(v *ejson.Validator, token string, cname, itype string)
- func CheckLabel(v *ejson.Validator, token string, label string)
- func CheckName(v *ejson.Validator, token interface{}, name string)
- func ConnectorExists(name string) (exists bool)
- func CountStartedJobExecutions(conn pg.Conn, scope Scope) (int64, error)
- func DecryptAES256(data []byte) ([]byte, error)
- func DeleteAccount(conn pg.Conn, accountId Id) error
- func DeleteExpiredJobExecutions(conn pg.Conn) (int64, error)
- func DeleteFavouriteJob(conn pg.Conn, jobId Id, scope Scope) error
- func DeleteJobs(conn pg.Conn, scope Scope) error
- func DeleteOldSessions(conn pg.Conn, retention int) (int64, error)
- func EncryptAES256(data []byte) ([]byte, error)
- func EventDefExists(ref EventRef) bool
- func EventExists(cname, name string) bool
- func GenerateSalt() []byte
- func HashAPIKey(key string) []byte
- func HashPassword(password string, salt []byte) []byte
- func IdentityExists(cname, itype string) bool
- func IdentityNameExists(conn pg.Conn, name string, scope Scope) (bool, error)
- func IsJobAbortedError(err error) bool
- func JSONFields(value interface{}) (map[string]string, error)
- func LoadJobNamesById(conn pg.Conn, ids Ids) (map[Id]string, error)
- func LoadJobStats(conn pg.Conn, jobIds Ids, scope Scope) (map[Id]*JobStats, error)
- func LoadLastJobExecutions(conn pg.Conn, jobIds Ids, scope Scope) (map[Id]*JobExecution, error)
- func ProjectNameExists(conn pg.Conn, name string) (bool, error)
- func RenderTermData(rawData string) (string, error)
- func ReversePageElements(elts []PageElement)
- func StartsWithShebang(data string) bool
- func SubscriptionParametersEqual(sp1, sp2 SubscriptionParameters) bool
- func UpdateAccountLastProjectId(conn pg.Conn, accountId Id, projectId *Id) error
- func UpdateAccountsForProjectDeletion(conn pg.Conn, projectId Id) error
- func UpdateSessionsForProjectDeletion(conn pg.Conn, projectId Id) error
- func UsernameExists(conn pg.Conn, username string) (bool, error)
- func ValidateConnectorName(name string) error
- type APIKey
- func (k *APIKey) Delete(conn pg.Conn, scope Scope) error
- func (k *APIKey) FromRow(row pgx.Row) error
- func (k *APIKey) Insert(conn pg.Conn) error
- func (k *APIKey) LoadForUpdate(conn pg.Conn, id Id, scope Scope) error
- func (k *APIKey) LoadUpdateByKeyHash(conn pg.Conn, keyHash []byte) error
- func (k *APIKey) SortKey(sort string) (key string)
- type APIKeys
- type Account
- func (a *Account) CheckPassword(password string) bool
- func (a *Account) FromRow(row pgx.Row) error
- func (a *Account) Insert(conn pg.Conn) error
- func (a *Account) Load(conn pg.Conn, id Id) error
- func (a *Account) LoadByUsernameForUpdate(conn pg.Conn, username string) error
- func (a *Account) LoadForUpdate(conn pg.Conn, id Id) error
- func (a *Account) SelfUpdate(conn pg.Conn) error
- func (a *Account) SortKey(sort string) (key string)
- func (a *Account) Update(conn pg.Conn) error
- func (a *Account) UpdateForLogin(conn pg.Conn) error
- type AccountPasswordUpdate
- type AccountProjectScope
- type AccountRole
- type AccountScope
- type AccountSelfUpdate
- type AccountSettings
- type AccountUpdate
- type Accounts
- type CommandData
- type Connector
- type ConnectorCfg
- type ConnectorDef
- func (c *ConnectorDef) AddEvent(edef *EventDef)
- func (c *ConnectorDef) AddIdentity(idef *IdentityDef)
- func (c *ConnectorDef) Event(typeName string) *EventDef
- func (c *ConnectorDef) EventExists(typeName string) (exists bool)
- func (c *ConnectorDef) Identity(typeName string) *IdentityDef
- func (c *ConnectorDef) IdentityExists(typeName string) (exists bool)
- func (c *ConnectorDef) ValidateEventName(name string) error
- func (c *ConnectorDef) ValidateIdentityType(typeName string) error
- type ConnectorInitData
- type Cursor
- func (pc *Cursor) ParseQuery(query url.Values, sorts Sorts, accountSettings *AccountSettings) error
- func (c *Cursor) Query() url.Values
- func (c *Cursor) SQLConditionOrderLimit(sorts Sorts) string
- func (c *Cursor) SQLConditionOrderLimit2(sorts Sorts, correlation string) string
- func (c *Cursor) URL() *url.URL
- type DateFormat
- type Event
- type EventData
- type EventDef
- type EventRef
- type Events
- type ExecutionContext
- type ExternalSubscriptionError
- type FavouriteJob
- type FileSet
- type FileSetFile
- type Filter
- type Filters
- type GlobalScope
- type Id
- type Identities
- func (is *Identities) AddFromRow(row pgx.Row) error
- func (is *Identities) LoadAllForUpdate(conn pg.Conn, scope Scope) error
- func (is *Identities) LoadByNames(conn pg.Conn, names []string, scope Scope) error
- func (is *Identities) LoadByNamesForUpdate(conn pg.Conn, names []string, scope Scope) error
- func (is Identities) Page(cursor *Cursor) *Page
- type Identity
- func (i *Identity) Delete(conn pg.Conn) error
- func (i *Identity) FromRow(row pgx.Row) error
- func (i *Identity) Insert(conn pg.Conn) error
- func (i *Identity) IsUsed(conn pg.Conn, scope Scope) (bool, error)
- func (i *Identity) IsUsedByJob(conn pg.Conn, scope Scope) (bool, error)
- func (i *Identity) IsUsedBySubscription(conn pg.Conn) (bool, error)
- func (i *Identity) Load(conn pg.Conn, id Id, scope Scope) error
- func (i *Identity) LoadByName(conn pg.Conn, name string, scope Scope) error
- func (i *Identity) LoadForUpdate(conn pg.Conn, id Id, scope Scope) error
- func (pi *Identity) MarshalJSON() ([]byte, error)
- func (i *Identity) Refreshable() bool
- func (i *Identity) SortKey(sort string) (key string)
- func (pi *Identity) UnmarshalJSON(data []byte) error
- func (i *Identity) Update(conn pg.Conn) error
- func (i *Identity) UpdateForProjectDeletion(conn pg.Conn) error
- func (i *Identity) UpdateLastUseTime(conn pg.Conn) error
- type IdentityData
- type IdentityDataDef
- type IdentityDataEntry
- type IdentityDataType
- type IdentityDef
- type IdentityStatus
- type Ids
- type Job
- func (j *Job) Delete(conn pg.Conn, scope Scope) error
- func (j *Job) FromRow(row pgx.Row) error
- func (j *Job) Load(conn pg.Conn, id Id, scope Scope) error
- func (j *Job) LoadByName(conn pg.Conn, name string, scope Scope) error
- func (j *Job) LoadForUpdate(conn pg.Conn, id Id, scope Scope) error
- func (j *Job) LoadRunningTimes(conn pg.Conn, params *MetricParameters) (MetricPoints, error)
- func (j *Job) LoadStatusCounts(conn pg.Conn, params *MetricParameters) (MetricPoints, error)
- func (j *Job) SortKey(sort string) (key string)
- func (j *Job) Update(conn pg.Conn, scope Scope) error
- func (j *Job) UpdateRename(conn pg.Conn, scope Scope) error
- func (j *Job) Upsert(conn pg.Conn) (Id, error)
- type JobExecution
- func (je *JobExecution) Duration() *time.Duration
- func (je *JobExecution) Finished() bool
- func (je *JobExecution) FromRow(row pgx.Row) error
- func (je *JobExecution) Insert(conn pg.Conn) error
- func (je *JobExecution) Load(conn pg.Conn, id Id, scope Scope) error
- func (je *JobExecution) LoadForUpdate(conn pg.Conn, id Id, scope Scope) error
- func (je *JobExecution) LoadForUpdateNoScope(conn pg.Conn, id Id) error
- func (je *JobExecution) SortKey(sort string) (key string)
- func (je *JobExecution) Update(conn pg.Conn) error
- func (je *JobExecution) UpdateRefreshTime(conn pg.Conn) error
- type JobExecutionAbortedError
- type JobExecutionFinishedError
- type JobExecutionInput
- type JobExecutionNotFinishedError
- type JobExecutionPageOptions
- type JobExecutionStatus
- type JobExecutions
- type JobPageOptions
- type JobRenamingData
- type JobRunner
- type JobSpec
- type JobSpecs
- type JobStats
- type JobStatsList
- type Jobs
- type MetricGranularity
- type MetricParameters
- type MetricPoint
- type MetricPoints
- type NewAPIKey
- type NewAccount
- type NewEvent
- type NewIdentity
- type NewProject
- type NewSession
- type Notification
- type NullProjectScope
- type OAuth2IdentityData
- type OptionalConnector
- type Order
- type Page
- func LoadAPIKeyPage(conn pg.Conn, cursor *Cursor, scope Scope) (*Page, error)
- func LoadAccountPage(conn pg.Conn, cursor *Cursor) (*Page, error)
- func LoadEventPage(conn pg.Conn, cursor *Cursor, scope Scope) (*Page, error)
- func LoadIdentityPage(conn pg.Conn, cursor *Cursor, scope Scope) (*Page, error)
- func LoadJobExecutionPage(conn pg.Conn, options JobExecutionPageOptions, cursor *Cursor, scope Scope) (*Page, error)
- func LoadJobPage(conn pg.Conn, options JobPageOptions, cursor *Cursor, scope Scope) (*Page, error)
- func LoadProjectPage(conn pg.Conn, cursor *Cursor) (*Page, error)
- func NewPage(cursor *Cursor, elements []PageElement, sorts Sorts) *Page
- type PageElement
- type Parameter
- func (p *Parameter) CheckValue(v *ejson.Validator, token string, value interface{}) interface{}
- func (p *Parameter) Label() string
- func (pp *Parameter) MarshalJSON() ([]byte, error)
- func (pp *Parameter) UnmarshalJSON(data []byte) error
- func (p *Parameter) ValidateJSON(v *ejson.Validator)
- func (p *Parameter) ValueString(value interface{}) (s string)
- type ParameterType
- type Parameters
- type Project
- func (p *Project) Delete(conn pg.Conn) error
- func (p *Project) FromRow(row pgx.Row) error
- func (p *Project) Insert(conn pg.Conn) error
- func (p *Project) Load(conn pg.Conn, id Id) error
- func (p *Project) LoadByName(conn pg.Conn, name string) error
- func (p *Project) LoadForUpdate(conn pg.Conn, id Id) error
- func (p *Project) SortKey(sort string) (key string)
- func (p *Project) Update(conn pg.Conn) error
- type ProjectNotificationSettings
- func (ps *ProjectNotificationSettings) Check(v *ejson.Validator)
- func (ps *ProjectNotificationSettings) CheckEmailAddresses(v *ejson.Validator, allowedDomains []string)
- func (ps *ProjectNotificationSettings) FromRow(row pgx.Row) error
- func (ps *ProjectNotificationSettings) Insert(conn pg.Conn) error
- func (ps *ProjectNotificationSettings) Load(conn pg.Conn, id Id) error
- func (ps *ProjectNotificationSettings) Update(conn pg.Conn) error
- type ProjectScope
- type ProjectSettings
- type Projects
- type RawIdentities
- type RawIdentity
- type RawNewIdentity
- type RefreshableOAuth2IdentityData
- type Runner
- func (r *Runner) HandleError(err error)
- func (r *Runner) HandleInterruption()
- func (r *Runner) Start() error
- func (r *Runner) StepCommand(se *StepExecution, s *Step, rootPath string) (name string, args []string)
- func (r *Runner) StepCommandString(se *StepExecution, s *Step, rootPath string) string
- func (r *Runner) Stopping() bool
- func (r *Runner) UpdateStepExecutionOutput(se *StepExecution, data []byte) error
- type RunnerBehaviour
- type RunnerCfg
- type RunnerData
- type RunnerDef
- type RunnerInitData
- type RunnerParameters
- type Scope
- type Session
- type SessionData
- type Shebang
- type Sorts
- type Step
- type StepCommand
- type StepExecution
- func (se *StepExecution) ClearOutput(conn pg.Conn) error
- func (se *StepExecution) Duration() *time.Duration
- func (se *StepExecution) Finished() bool
- func (se *StepExecution) FromRow(row pgx.Row) error
- func (se *StepExecution) Insert(conn pg.Conn) error
- func (se *StepExecution) Load(conn pg.Conn, id Id, scope Scope) error
- func (se *StepExecution) Update(conn pg.Conn) error
- func (se *StepExecution) UpdateOutput(conn pg.Conn, data []byte) error
- type StepExecutionStatus
- type StepExecutions
- func (ses *StepExecutions) AddFromRow(row pgx.Row) error
- func (ses *StepExecutions) LoadByJobExecutionId(conn pg.Conn, jeId Id) error
- func (ses *StepExecutions) LoadByJobExecutionIdForUpdate(conn pg.Conn, jeId Id) error
- func (ses *StepExecutions) LoadByJobExecutionIdWithTruncatedOutput(conn pg.Conn, jeId Id, maxOutputSize int, truncationString string) error
- type StepFailureAction
- type StepFailureError
- type StepScript
- type Steps
- type SubscribableConnector
- type Subscription
- func (s *Subscription) Delete(conn pg.Conn) error
- func (s *Subscription) EventDef() *EventDef
- func (s *Subscription) FromRow(row pgx.Row) error
- func (s *Subscription) Insert(conn pg.Conn) error
- func (s *Subscription) Load(conn pg.Conn, id Id) error
- func (s *Subscription) LoadByJobForUpdate(conn pg.Conn, jobId Id, scope Scope) error
- func (s *Subscription) NewEvent(cname, ename string, etime *time.Time, data EventData) *Event
- func (s *Subscription) Update(conn pg.Conn) error
- func (s *Subscription) UpdateOp(conn pg.Conn) error
- type SubscriptionContext
- type SubscriptionParameters
- type SubscriptionStatus
- type Subscriptions
- type Trigger
- type UnknownAPIKeyError
- type UnknownAccountError
- type UnknownConnectorDefError
- type UnknownEventDefError
- type UnknownEventError
- type UnknownIdentityDefError
- type UnknownIdentityError
- type UnknownIdentityNameError
- type UnknownJobError
- type UnknownJobExecutionError
- type UnknownJobNameError
- type UnknownJobSubscriptionError
- type UnknownProjectError
- type UnknownProjectNameError
- type UnknownSessionError
- type UnknownStepExecutionError
- type UnknownSubscriptionError
- type UnknownUsernameError
- type Worker
- type WorkerBehaviour
- type WorkerCfg
Constants ¶
View Source
const ( MinUsernameLength = 3 MaxUsernameLength = 100 MinPasswordLength = 8 MaxPasswordLength = 100 SaltSize = 32 // bytes // Current OWASP recommendations are 310'000+ // (https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2). // // Note that changing it requires re-hashing all password hashes in the // database. Do not change it. NbPBKDF2Iterations = 350_000 )
View Source
const ( MinNameLength = 1 MaxNameLength = 100 MinLabelLength = 1 MaxLabelLength = 100 MinDescriptionLength = 1 MaxDescriptionLength = 500 )
View Source
const ( DefaultCursorSize = 20 MinCursorSize = 1 MaxCursorSize = 100 )
View Source
const ( MinPageSize = 1 MaxPageSize = 100 )
View Source
const DefaultSort = "id"
Variables ¶
View Source
var AccountRoleValues = []AccountRole{ AccountRoleUser, AccountRoleAdmin, }
View Source
var Connectors = map[string]Connector{}
View Source
var DateFormatValues = []DateFormat{ DateFormatAbsolute, DateFormatRelative, }
View Source
var GlobalEncryptionKey cryptoutils.AES256Key
View Source
var JobExecutionStatusValues = []JobExecutionStatus{ JobExecutionStatusCreated, JobExecutionStatusStarted, JobExecutionStatusAborted, JobExecutionStatusSuccessful, JobExecutionStatusFailed, }
View Source
var (
NameRE = regexp.MustCompile(`^[a-z0-9][a-z0-9\-_]*$`)
)
View Source
var ParameterTypeValues = []ParameterType{ ParameterTypeNumber, ParameterTypeInteger, ParameterTypeString, ParameterTypeBoolean, }
View Source
var RunnerDefs = map[string]*RunnerDef{}
View Source
var StepExecutionStatusValues = []StepExecutionStatus{ StepExecutionStatusCreated, StepExecutionStatusStarted, StepExecutionStatusAborted, StepExecutionStatusSuccessful, StepExecutionStatusFailed, }
View Source
var StepFailureActionValues = []StepFailureAction{ StepFailureActionAbort, StepFailureActionContinue, }
View Source
var TemplateFuncMap = map[string]interface{}{ "add": func(a, b int) int { return a + b }, "sub": func(a, b int) int { return a - b }, "toSentence": utils.ToSentence, "join": strings.Join, "stringMember": func(s string, ss []string) bool { for _, s2 := range ss { if s == s2 { return true } } return false }, "quoteString": func(s string) string { return fmt.Sprintf("%q", s) }, }
View Source
var ZeroId = ksuid.Zero
Functions ¶
func CheckConnectorName ¶
func CheckEventName ¶
func CheckIdentityName ¶
func ConnectorExists ¶
func DecryptAES256 ¶
func DeleteExpiredJobExecutions ¶ added in v1.0.0
func DeleteOldSessions ¶ added in v1.0.0
func EncryptAES256 ¶
func EventDefExists ¶
func EventExists ¶
func GenerateSalt ¶
func GenerateSalt() []byte
func HashAPIKey ¶
func HashPassword ¶
func IdentityExists ¶
func IdentityNameExists ¶
func IsJobAbortedError ¶
func JSONFields ¶
func LoadJobStats ¶
func LoadLastJobExecutions ¶
func RenderTermData ¶ added in v1.0.0
func ReversePageElements ¶
func ReversePageElements(elts []PageElement)
func StartsWithShebang ¶
func SubscriptionParametersEqual ¶
func SubscriptionParametersEqual(sp1, sp2 SubscriptionParameters) bool
func ValidateConnectorName ¶
Types ¶
type APIKey ¶
type APIKey struct {
Id Id `json:"id"`
AccountId Id `json:"account_id"`
Name string `json:"name"`
CreationTime time.Time `json:"creation_time"`
LastUseTime *time.Time `json:"last_use_time,omitempty"`
KeyHash []byte `json:"-"`
}
func (*APIKey) LoadForUpdate ¶
func (*APIKey) LoadUpdateByKeyHash ¶
type Account ¶
type Account struct {
Id Id `json:"id"`
CreationTime time.Time `json:"creation_time"`
Username string `json:"username"`
Salt []byte `json:"-"`
PasswordHash []byte `json:"-"`
Role AccountRole `json:"role"`
LastLoginTime *time.Time `json:"last_login_time,omitempty"`
LastProjectId *Id `json:"last_project_id,omitempty"`
Settings *AccountSettings `json:"settings"`
}
func (*Account) CheckPassword ¶
func (*Account) LoadByUsernameForUpdate ¶
type AccountPasswordUpdate ¶
type AccountPasswordUpdate struct {
Password string `json:"password"`
PasswordConfirmation string `json:"password_confirmation"`
}
func (*AccountPasswordUpdate) ValidateJSON ¶ added in v1.1.0
func (au *AccountPasswordUpdate) ValidateJSON(v *ejson.Validator)
type AccountProjectScope ¶
func (*AccountProjectScope) SQLCondition ¶
func (scope *AccountProjectScope) SQLCondition() string
func (*AccountProjectScope) SQLCondition2 ¶
func (scope *AccountProjectScope) SQLCondition2(correlation string) string
type AccountRole ¶
type AccountRole string
const ( AccountRoleUser AccountRole = "user" AccountRoleAdmin AccountRole = "admin" )
type AccountScope ¶
type AccountScope struct {
AccountId Id
}
func (*AccountScope) SQLCondition ¶
func (scope *AccountScope) SQLCondition() string
func (*AccountScope) SQLCondition2 ¶
func (scope *AccountScope) SQLCondition2(correlation string) string
type AccountSelfUpdate ¶
type AccountSelfUpdate struct {
Settings *AccountSettings `json:"settings"`
}
func (*AccountSelfUpdate) ValidateJSON ¶ added in v1.1.0
func (au *AccountSelfUpdate) ValidateJSON(v *ejson.Validator)
type AccountSettings ¶
type AccountSettings struct {
DateFormat DateFormat `json:"date_format,omitempty"`
PageSize int `json:"page_size,omitempty"`
}
func DefaultAccountSettings ¶
func DefaultAccountSettings() *AccountSettings
func (*AccountSettings) ValidateJSON ¶ added in v1.1.0
func (as *AccountSettings) ValidateJSON(v *ejson.Validator)
type AccountUpdate ¶
type AccountUpdate struct {
Username string `json:"username"`
Role AccountRole `json:"role"`
}
func (*AccountUpdate) ValidateJSON ¶ added in v1.1.0
func (au *AccountUpdate) ValidateJSON(v *ejson.Validator)
type CommandData ¶
type CommandData struct {
Parameters []*Parameter `json:"parameters,omitempty"`
Pipelines []string `json:"pipelines"` //names
}
func (*CommandData) ValidateJSON ¶ added in v1.1.0
func (d *CommandData) ValidateJSON(v *ejson.Validator)
type Connector ¶
type Connector interface {
Name() string
Definition() *ConnectorDef
DefaultCfg() ConnectorCfg
Init(ConnectorCfg, ConnectorInitData) error
Terminate()
}
func FindConnector ¶
func GetConnector ¶
type ConnectorCfg ¶
type ConnectorCfg interface {
ejson.Validatable
}
type ConnectorDef ¶
type ConnectorDef struct {
Name string
Identities map[string]*IdentityDef
Events map[string]*EventDef
Worker WorkerBehaviour
}
func GetConnectorDef ¶
func GetConnectorDef(name string) *ConnectorDef
func NewConnectorDef ¶
func NewConnectorDef(name string) *ConnectorDef
func (*ConnectorDef) AddEvent ¶
func (c *ConnectorDef) AddEvent(edef *EventDef)
func (*ConnectorDef) AddIdentity ¶
func (c *ConnectorDef) AddIdentity(idef *IdentityDef)
func (*ConnectorDef) Event ¶
func (c *ConnectorDef) Event(typeName string) *EventDef
func (*ConnectorDef) EventExists ¶
func (c *ConnectorDef) EventExists(typeName string) (exists bool)
func (*ConnectorDef) Identity ¶
func (c *ConnectorDef) Identity(typeName string) *IdentityDef
func (*ConnectorDef) IdentityExists ¶
func (c *ConnectorDef) IdentityExists(typeName string) (exists bool)
func (*ConnectorDef) ValidateEventName ¶
func (c *ConnectorDef) ValidateEventName(name string) error
func (*ConnectorDef) ValidateIdentityType ¶
func (c *ConnectorDef) ValidateIdentityType(typeName string) error
type ConnectorInitData ¶
type Cursor ¶
type Cursor struct {
Before string `json:"before,omitempty"`
After string `json:"after,omitempty"`
Size int `json:"size,omitempty"`
Sort string `json:"sort,omitempty"`
Order Order `json:"order,omitempty"`
}
func (*Cursor) ParseQuery ¶
func (*Cursor) SQLConditionOrderLimit ¶
func (*Cursor) SQLConditionOrderLimit2 ¶
type DateFormat ¶
type DateFormat string
const ( DateFormatAbsolute DateFormat = "absolute" DateFormatRelative DateFormat = "relative" )
type Event ¶
type Event struct {
Id Id `json:"id"`
ProjectId Id `json:"project_id"`
JobId Id `json:"job_id"`
CreationTime time.Time `json:"creation_time"`
EventTime time.Time `json:"event_time"`
Connector string `json:"connector"`
Name string `json:"name"`
Data EventData `json:"data"`
DataValue interface{} `json:"-"`
Processed bool `json:"processed,omitempty"`
OriginalEventId *Id `json:"original_event_id,omitempty"`
}
type EventDef ¶
type EventDef struct {
Name string
Data EventData
SubscriptionParameters SubscriptionParameters
}
func GetEventDef ¶
func NewEventDef ¶
func NewEventDef(name string, data EventData, subscriptionParameters SubscriptionParameters) *EventDef
func (*EventDef) DecodeSubscriptionParameters ¶
func (edef *EventDef) DecodeSubscriptionParameters(data []byte) (SubscriptionParameters, error)
type ExecutionContext ¶
type ExecutionContext struct {
Event *Event `json:"event,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
Identities map[string]*Identity `json:"identities,omitempty"`
}
func (*ExecutionContext) Encode ¶
func (ctx *ExecutionContext) Encode() ([]byte, error)
func (*ExecutionContext) Load ¶
func (ctx *ExecutionContext) Load(conn pg.Conn, je *JobExecution) error
type ExternalSubscriptionError ¶
type ExternalSubscriptionError struct {
Err error
}
func NewExternalSubscriptionError ¶
func NewExternalSubscriptionError(err error) *ExternalSubscriptionError
func (ExternalSubscriptionError) Error ¶
func (err ExternalSubscriptionError) Error() string
type FavouriteJob ¶
type FileSet ¶
type FileSet struct {
Files map[string]*FileSetFile
}
func NewFileSet ¶
func NewFileSet() *FileSet
type FileSetFile ¶
type Filter ¶
type Filter struct {
Path ejson.Pointer `json:"path"`
IsEqualTo interface{} `json:"is_equal_to,omitempty"`
IsNotEqualTo interface{} `json:"is_not_equal_to,omitempty"`
Matches string `json:"matches,omitempty"`
MatchesRE *regexp.Regexp `json:"-"`
DoesNotMatch string `json:"does_not_match,omitempty"`
DoesNotMatchRE *regexp.Regexp `json:"-"`
}
func (*Filter) MarshalJSON ¶
func (*Filter) ValidateJSON ¶ added in v1.1.0
type GlobalScope ¶
type GlobalScope struct {
}
func NewGlobalScope ¶
func NewGlobalScope() *GlobalScope
func (*GlobalScope) SQLCondition ¶
func (scope *GlobalScope) SQLCondition() string
func (*GlobalScope) SQLCondition2 ¶
func (scope *GlobalScope) SQLCondition2(correlation string) string
type Id ¶
func GenerateId ¶
func GenerateId() Id
type Identities ¶
type Identities []*Identity
func (*Identities) AddFromRow ¶
func (is *Identities) AddFromRow(row pgx.Row) error
func (*Identities) LoadAllForUpdate ¶
func (is *Identities) LoadAllForUpdate(conn pg.Conn, scope Scope) error
func (*Identities) LoadByNames ¶
func (*Identities) LoadByNamesForUpdate ¶
func (Identities) Page ¶
func (is Identities) Page(cursor *Cursor) *Page
type Identity ¶
type Identity struct {
Id Id `json:"id"`
ProjectId *Id `json:"project_id"`
Name string `json:"name"`
Status IdentityStatus `json:"status"`
ErrorMessage string `json:"error_message,omitempty"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
LastUseTime *time.Time `json:"last_use_time,omitempty"`
RefreshTime *time.Time `json:"refresh_time,omitempty"`
Connector string `json:"connector"`
Type string `json:"type"`
Data IdentityData `json:"-"`
RawData json.RawMessage `json:"data"`
}
func (*Identity) IsUsedByJob ¶
func (*Identity) IsUsedBySubscription ¶
func (*Identity) LoadByName ¶ added in v1.1.0
func (*Identity) LoadForUpdate ¶
func (*Identity) MarshalJSON ¶
func (*Identity) Refreshable ¶
func (*Identity) UnmarshalJSON ¶
func (*Identity) UpdateForProjectDeletion ¶
type IdentityData ¶
type IdentityData interface {
ejson.Validatable
Def() *IdentityDataDef
Environment() map[string]string
}
type IdentityDataDef ¶
type IdentityDataDef struct {
Entries []*IdentityDataEntry
}
func NewIdentityDataDef ¶
func NewIdentityDataDef() *IdentityDataDef
func (*IdentityDataDef) AddEntry ¶
func (v *IdentityDataDef) AddEntry(e *IdentityDataEntry)
type IdentityDataEntry ¶
type IdentityDataEntry struct {
Key string
Label string
Value interface{}
Type IdentityDataType
EnumValues []string
PreselectedEnumValues []string
MultiselectEnumSize int // size of the multiselect html element
Optional bool
Verbatim bool
Secret bool
Internal bool // set by eventline, not by the user
}
type IdentityDataType ¶
type IdentityDataType string
const ( IdentityDataTypeString IdentityDataType = "string" IdentityDataTypeStringList IdentityDataType = "string_list" IdentityDataTypeEnum IdentityDataType = "enum" IdentityDataTypeEnumList IdentityDataType = "enum_list" IdentityDataTypeDate IdentityDataType = "date" IdentityDataTypeURI IdentityDataType = "uri" IdentityDataTypeTextBlock IdentityDataType = "text_block" IdentityDataTypeBoolean IdentityDataType = "boolean" )
type IdentityDef ¶
type IdentityDef struct {
Type string
DeferredReadiness bool
Refreshable bool
Data IdentityData
DataDef *IdentityDataDef // used when there is no actual identity
}
func NewIdentityDef ¶
func NewIdentityDef(typeName string, dataValue IdentityData) *IdentityDef
func (*IdentityDef) DecodeData ¶
func (idef *IdentityDef) DecodeData(data []byte) (IdentityData, error)
func (*IdentityDef) IsOAuth2 ¶
func (idef *IdentityDef) IsOAuth2() bool
type IdentityStatus ¶
type IdentityStatus string
const ( IdentityStatusPending IdentityStatus = "pending" IdentityStatusReady IdentityStatus = "ready" IdentityStatusError IdentityStatus = "error" )
type Job ¶
type Job struct {
Id Id `json:"id"`
ProjectId Id `json:"project_id"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
Disabled bool `json:"disabled,omitempty"`
Spec *JobSpec `json:"spec"`
}
func (*Job) LoadRunningTimes ¶
func (j *Job) LoadRunningTimes(conn pg.Conn, params *MetricParameters) (MetricPoints, error)
func (*Job) LoadStatusCounts ¶
func (j *Job) LoadStatusCounts(conn pg.Conn, params *MetricParameters) (MetricPoints, error)
func (*Job) UpdateRename ¶ added in v1.1.0
type JobExecution ¶
type JobExecution struct {
Id Id `json:"id"`
ProjectId Id `json:"project_id"`
JobId Id `json:"job_id"`
JobSpec *JobSpec `json:"job_spec"`
EventId *Id `json:"event_id,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
ScheduledTime time.Time `json:"scheduled_time,omitempty"`
Status JobExecutionStatus `json:"status"`
StartTime *time.Time `json:"start_time,omitempty"`
EndTime *time.Time `json:"end_time,omitempty"`
RefreshTime *time.Time `json:"refresh_time,omitempty"`
ExpirationTime *time.Time `json:"expiration_time,omitempty"`
FailureMessage string `json:"failure_message,omitempty"`
}
func LoadDeadJobExecution ¶ added in v1.0.0
func LoadDeadJobExecution(conn pg.Conn, timeout int) (*JobExecution, error)
func LoadJobExecutionForScheduling ¶
func LoadJobExecutionForScheduling(conn pg.Conn) (*JobExecution, error)
func LoadLastJobExecutionFinishedBefore ¶
func LoadLastJobExecutionFinishedBefore(conn pg.Conn, je *JobExecution) (*JobExecution, error)
func (*JobExecution) Duration ¶
func (je *JobExecution) Duration() *time.Duration
func (*JobExecution) Finished ¶
func (je *JobExecution) Finished() bool
func (*JobExecution) LoadForUpdate ¶
func (*JobExecution) LoadForUpdateNoScope ¶ added in v1.0.0
func (je *JobExecution) LoadForUpdateNoScope(conn pg.Conn, id Id) error
func (*JobExecution) SortKey ¶
func (je *JobExecution) SortKey(sort string) (key string)
func (*JobExecution) UpdateRefreshTime ¶ added in v1.0.0
func (je *JobExecution) UpdateRefreshTime(conn pg.Conn) error
type JobExecutionAbortedError ¶
type JobExecutionAbortedError struct {
Id Id
}
func (*JobExecutionAbortedError) Error ¶
func (err *JobExecutionAbortedError) Error() string
type JobExecutionFinishedError ¶
type JobExecutionFinishedError struct {
Id Id
}
func (*JobExecutionFinishedError) Error ¶
func (err *JobExecutionFinishedError) Error() string
type JobExecutionInput ¶
type JobExecutionInput struct {
Parameters map[string]interface{} `json:"-"`
RawParameters json.RawMessage `json:"parameters"`
}
func (*JobExecutionInput) MarshalJSON ¶
func (pi *JobExecutionInput) MarshalJSON() ([]byte, error)
func (*JobExecutionInput) UnmarshalJSON ¶
func (pi *JobExecutionInput) UnmarshalJSON(data []byte) error
type JobExecutionNotFinishedError ¶
type JobExecutionNotFinishedError struct {
Id Id
}
func (*JobExecutionNotFinishedError) Error ¶
func (err *JobExecutionNotFinishedError) Error() string
type JobExecutionPageOptions ¶
type JobExecutionPageOptions struct {
JobId *Id
}
type JobExecutionStatus ¶
type JobExecutionStatus string
const ( JobExecutionStatusCreated JobExecutionStatus = "created" JobExecutionStatusStarted JobExecutionStatus = "started" JobExecutionStatusAborted JobExecutionStatus = "aborted" JobExecutionStatusSuccessful JobExecutionStatus = "successful" JobExecutionStatusFailed JobExecutionStatus = "failed" )
type JobExecutions ¶
type JobExecutions []*JobExecution
func (*JobExecutions) AddFromRow ¶
func (jes *JobExecutions) AddFromRow(row pgx.Row) error
func (*JobExecutions) LoadByEvent ¶
func (jes *JobExecutions) LoadByEvent(conn pg.Conn, eventId Id) error
func (JobExecutions) Page ¶
func (jes JobExecutions) Page(cursor *Cursor) *Page
type JobPageOptions ¶
type JobPageOptions struct {
ExcludeFavouriteJobAccountId *Id
}
type JobRenamingData ¶ added in v1.1.0
type JobRenamingData struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
func (*JobRenamingData) ValidateJSON ¶ added in v1.1.0
func (data *JobRenamingData) ValidateJSON(v *ejson.Validator)
type JobRunner ¶
type JobRunner struct {
Name string `json:"name"`
Parameters RunnerParameters `json:"-"`
RawParameters json.RawMessage `json:"parameters"`
Identity string `json:"identity,omitempty"`
}
func (*JobRunner) MarshalJSON ¶
func (*JobRunner) UnmarshalJSON ¶
func (*JobRunner) ValidateJSON ¶ added in v1.1.0
type JobSpec ¶
type JobSpec struct {
Name string `json:"name"`
Description string `json:"description"`
Trigger *Trigger `json:"trigger,omitempty"`
Parameters Parameters `json:"parameters,omitempty"`
Runner *JobRunner `json:"runner"`
Concurrent bool `json:"concurrent,omitempty"`
Retention int `json:"retention,omitempty"` // days
Identities []string `json:"identities,omitempty"`
Environment map[string]string `json:"environment,omitempty"`
Steps Steps `json:"steps"`
}
func (*JobSpec) IdentityNames ¶
func (JobSpec) ValidateJSON ¶ added in v1.1.0
type JobStats ¶
type JobStats struct {
JobId Id `json:"job_id"`
NbExecutions int `json:"nb_executions"`
DurationP50 *time.Duration `json:"duration_p50,omitempty"`
SuccessRatio float64 `json:"success_ratio"` // last 7 days
}
func (*JobStats) SuccessPercentage ¶
func (*JobStats) SuccessPercentageString ¶
type JobStatsList ¶
type JobStatsList []*JobStats
func (*JobStatsList) AddFromRow ¶
func (jss *JobStatsList) AddFromRow(row pgx.Row) error
type MetricGranularity ¶
type MetricGranularity string
const ( MetricGranularityDay MetricGranularity = "day" MetricGranularityHour MetricGranularity = "hour" )
type MetricParameters ¶
type MetricParameters struct {
Start time.Time
End time.Time
Granularity MetricGranularity
}
type MetricPoint ¶
type MetricPoint []interface{}
type MetricPoints ¶
type MetricPoints []MetricPoint
func (*MetricPoints) AddFromRow ¶
func (ps *MetricPoints) AddFromRow(row pgx.Row) error
type NewAPIKey ¶
type NewAPIKey struct {
Name string `json:"name"`
}
func (*NewAPIKey) ValidateJSON ¶ added in v1.1.0
type NewAccount ¶
type NewAccount struct {
Username string `json:"username"`
Password string `json:"password"`
PasswordConfirmation string `json:"password_confirmation"`
Role AccountRole `json:"role"`
}
func (*NewAccount) ValidateJSON ¶ added in v1.1.0
func (na *NewAccount) ValidateJSON(v *ejson.Validator)
type NewEvent ¶
type NewEvent struct {
EventTime time.Time `json:"event_time"`
Connector string `json:"connector"`
Name string `json:"name"`
Data EventData `json:"-"`
RawData json.RawMessage `json:"data"`
}
func (*NewEvent) UnmarshalJSON ¶
func (*NewEvent) ValidateJSON ¶ added in v1.1.0
type NewIdentity ¶
type NewIdentity struct {
Name string `json:"name"`
Connector string `json:"connector"`
Type string `json:"type"`
Data IdentityData `json:"-"`
RawData json.RawMessage `json:"data"`
}
func (*NewIdentity) IsOAuth2 ¶ added in v1.1.0
func (i *NewIdentity) IsOAuth2() bool
func (*NewIdentity) MarshalJSON ¶
func (pni *NewIdentity) MarshalJSON() ([]byte, error)
func (*NewIdentity) UnmarshalJSON ¶
func (pni *NewIdentity) UnmarshalJSON(data []byte) error
func (*NewIdentity) ValidateJSON ¶ added in v1.1.0
func (ni *NewIdentity) ValidateJSON(v *ejson.Validator)
type NewProject ¶
type NewProject struct {
Name string `json:"name"`
}
func (*NewProject) ValidateJSON ¶ added in v1.1.0
func (np *NewProject) ValidateJSON(v *ejson.Validator)
type NewSession ¶
type NewSession struct {
Data *SessionData `json:"data"`
AccountRole AccountRole `json:"account_role"`
AccountSettings *AccountSettings `json:"account_settings"`
}
type Notification ¶
type Notification struct {
Id Id
ProjectId Id
Recipients []string
Message []byte
NextDeliveryTime time.Time
DeliveryDelay int // seconds
}
func LoadNotificationForDelivery ¶
func LoadNotificationForDelivery(conn pg.Conn) (*Notification, error)
type NullProjectScope ¶
type NullProjectScope struct {
}
func (*NullProjectScope) SQLCondition ¶
func (scope *NullProjectScope) SQLCondition() string
func (*NullProjectScope) SQLCondition2 ¶
func (scope *NullProjectScope) SQLCondition2(correlation string) string
type OAuth2IdentityData ¶
type OptionalConnector ¶
The optional aspect of the connector is related to events only. But at this point I do not have a better idea for a name.
type Page ¶
type Page struct {
Elements []PageElement `json:"elements"`
Previous *Cursor `json:"previous,omitempty"`
Next *Cursor `json:"next,omitempty"`
}
func LoadIdentityPage ¶
func LoadJobExecutionPage ¶
func LoadJobPage ¶
func (*Page) HasPreviousOrNextURI ¶
func (*Page) PreviousURI ¶
type PageElement ¶
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
Type ParameterType `json:"type"`
Values []string `json:"values,omitempty"`
Default interface{} `json:"-"`
RawDefault json.RawMessage `json:"default,omitempty"`
Description string `json:"description,omitempty"`
Environment string `json:"environment,omitempty"`
}
func (*Parameter) CheckValue ¶
func (*Parameter) MarshalJSON ¶
func (*Parameter) UnmarshalJSON ¶
func (*Parameter) ValidateJSON ¶ added in v1.1.0
func (*Parameter) ValueString ¶
type ParameterType ¶
type ParameterType string
const ( ParameterTypeNumber ParameterType = "number" ParameterTypeInteger ParameterType = "integer" ParameterTypeString ParameterType = "string" ParameterTypeBoolean ParameterType = "boolean" )
type Parameters ¶
type Parameters []*Parameter
func (Parameters) CheckValues ¶
func (ps Parameters) CheckValues(v *ejson.Validator, token string, values map[string]interface{})
func (Parameters) Parameter ¶
func (ps Parameters) Parameter(name string) *Parameter
type Project ¶
type Project struct {
Id Id `json:"id"`
Name string `json:"name"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
}
func LoadMostRecentProject ¶ added in v1.0.8
type ProjectNotificationSettings ¶
type ProjectNotificationSettings struct {
Id Id `json:"id"` // ignored in input
OnSuccessfulJob bool `json:"on_successful_job,omitempty"`
OnFirstSuccessfulJob bool `json:"on_first_successful_job,omitempty"`
OnFailedJob bool `json:"on_failed_job,omitempty"`
OnAbortedJob bool `json:"on_aborted_job,omitempty"`
OnIdentityRefreshError bool `json:"on_identity_refresh_error,omitempty"`
EmailAddresses []string `json:"email_addresses"`
}
func (*ProjectNotificationSettings) Check ¶
func (ps *ProjectNotificationSettings) Check(v *ejson.Validator)
func (*ProjectNotificationSettings) CheckEmailAddresses ¶ added in v1.0.0
func (ps *ProjectNotificationSettings) CheckEmailAddresses(v *ejson.Validator, allowedDomains []string)
func (*ProjectNotificationSettings) FromRow ¶
func (ps *ProjectNotificationSettings) FromRow(row pgx.Row) error
func (*ProjectNotificationSettings) Insert ¶
func (ps *ProjectNotificationSettings) Insert(conn pg.Conn) error
type ProjectScope ¶
type ProjectScope struct {
ProjectId Id
}
func (*ProjectScope) SQLCondition ¶
func (scope *ProjectScope) SQLCondition() string
func (*ProjectScope) SQLCondition2 ¶
func (scope *ProjectScope) SQLCondition2(correlation string) string
type ProjectSettings ¶
type ProjectSettings struct {
Id Id `json:"id"` // Ignored in input
CodeHeader string `json:"code_header"`
}
func (*ProjectSettings) ValidateJSON ¶ added in v1.1.0
func (ps *ProjectSettings) ValidateJSON(v *ejson.Validator)
type RawIdentities ¶ added in v1.1.0
type RawIdentities []*RawIdentity
type RawIdentity ¶ added in v1.1.0
type RawIdentity Identity
type RawNewIdentity ¶ added in v1.1.0
type RawNewIdentity NewIdentity
type Runner ¶
type Runner struct {
Log *log.Logger
Pg *pg.Client
Cfg RunnerCfg
Behaviour RunnerBehaviour
JobExecution *JobExecution
StepExecutions StepExecutions
ExecutionContext *ExecutionContext
Project *Project
ProjectSettings *ProjectSettings
RunnerIdentity *Identity
Environment map[string]string
FileSet *FileSet
Scope Scope
StopChan <-chan struct{}
Wg *sync.WaitGroup
// contains filtered or unexported fields
}
func NewRunner ¶
func NewRunner(data RunnerInitData) (*Runner, error)
func (*Runner) HandleError ¶
func (*Runner) HandleInterruption ¶
func (r *Runner) HandleInterruption()
func (*Runner) StepCommand ¶
func (*Runner) StepCommandString ¶ added in v1.0.0
func (r *Runner) StepCommandString(se *StepExecution, s *Step, rootPath string) string
func (*Runner) UpdateStepExecutionOutput ¶
func (r *Runner) UpdateStepExecutionOutput(se *StepExecution, data []byte) error
type RunnerBehaviour ¶
type RunnerBehaviour interface {
DirPath() string
Init(ctx context.Context) error
Terminate()
ExecuteStep(context.Context, *StepExecution, *Step, io.WriteCloser, io.WriteCloser) error
}
type RunnerCfg ¶
type RunnerCfg interface {
ejson.Validatable
}
type RunnerData ¶
type RunnerData struct {
JobExecution *JobExecution
StepExecutions StepExecutions
ExecutionContext *ExecutionContext
Project *Project
ProjectSettings *ProjectSettings
}
func (*RunnerData) Environment ¶
func (rd *RunnerData) Environment() map[string]string
func (*RunnerData) FileSet ¶
func (rd *RunnerData) FileSet() (*FileSet, error)
type RunnerDef ¶
type RunnerDef struct {
Name string
Cfg RunnerCfg
InstantiateParameters func() RunnerParameters
InstantiateBehaviour func(*Runner) RunnerBehaviour
}
type RunnerInitData ¶
type RunnerParameters ¶
type RunnerParameters interface {
ejson.Validatable
}
type Scope ¶
func NewAccountProjectScope ¶
func NewAccountScope ¶
func NewNullProjectScope ¶
func NewNullProjectScope() Scope
func NewProjectScope ¶
type Session ¶
type Session struct {
Id Id `json:"id"`
AccountId Id `json:"account_id"`
CreationTime time.Time `json:"creation_time"`
UpdateTime time.Time `json:"update_time"`
Data *SessionData `json:"data"`
AccountRole AccountRole `json:"account_role"`
AccountSettings *AccountSettings `json:"account_settings"`
}
type SessionData ¶
type SessionData struct {
ProjectId *Id `json:"project_id,omitempty"`
}
type Step ¶
type Step struct {
Label string `json:"label,omitempty"`
Code string `json:"code,omitempty"`
Command *StepCommand `json:"command,omitempty"`
Script *StepScript `json:"script,omitempty"`
OnFailure StepFailureAction `json:"on_failure,omitempty"`
}
func (*Step) AbortOnFailure ¶
func (*Step) ValidateJSON ¶ added in v1.1.0
type StepCommand ¶
type StepCommand struct {
Name string `json:"name"`
Arguments []string `json:"arguments,omitempty"`
}
func (*StepCommand) ValidateJSON ¶ added in v1.1.0
func (s *StepCommand) ValidateJSON(v *ejson.Validator)
type StepExecution ¶
type StepExecution struct {
Id Id `json:"id"`
ProjectId Id `json:"project_id"`
JobExecutionId Id `json:"job_execution_id"`
Position int `json:"position"`
Status StepExecutionStatus `json:"status"`
StartTime *time.Time `json:"start_time,omitempty"`
EndTime *time.Time `json:"end_time,omitempty"`
FailureMessage string `json:"failure_message,omitempty"`
Output string `json:"output,omitempty"`
}
func (*StepExecution) ClearOutput ¶
func (se *StepExecution) ClearOutput(conn pg.Conn) error
func (*StepExecution) Duration ¶
func (se *StepExecution) Duration() *time.Duration
func (*StepExecution) Finished ¶
func (se *StepExecution) Finished() bool
func (*StepExecution) UpdateOutput ¶
func (se *StepExecution) UpdateOutput(conn pg.Conn, data []byte) error
type StepExecutionStatus ¶
type StepExecutionStatus string
const ( StepExecutionStatusCreated StepExecutionStatus = "created" StepExecutionStatusStarted StepExecutionStatus = "started" StepExecutionStatusAborted StepExecutionStatus = "aborted" StepExecutionStatusSuccessful StepExecutionStatus = "successful" StepExecutionStatusFailed StepExecutionStatus = "failed" )
type StepExecutions ¶
type StepExecutions []*StepExecution
func (*StepExecutions) AddFromRow ¶
func (ses *StepExecutions) AddFromRow(row pgx.Row) error
func (*StepExecutions) LoadByJobExecutionId ¶
func (ses *StepExecutions) LoadByJobExecutionId(conn pg.Conn, jeId Id) error
func (*StepExecutions) LoadByJobExecutionIdForUpdate ¶
func (ses *StepExecutions) LoadByJobExecutionIdForUpdate(conn pg.Conn, jeId Id) error
func (*StepExecutions) LoadByJobExecutionIdWithTruncatedOutput ¶ added in v1.0.7
type StepFailureAction ¶
type StepFailureAction string
const ( StepFailureActionAbort StepFailureAction = "abort" StepFailureActionContinue StepFailureAction = "continue" )
type StepFailureError ¶
type StepFailureError struct {
// contains filtered or unexported fields
}
func NewStepFailureError ¶
func NewStepFailureError(err error) *StepFailureError
func (*StepFailureError) Error ¶
func (err *StepFailureError) Error() string
func (*StepFailureError) Unwrap ¶
func (err *StepFailureError) Unwrap() error
type StepScript ¶
type StepScript struct {
Path string `json:"path"`
Arguments []string `json:"arguments,omitempty"`
Content string `json:"content,omitempty"` // content of the script file
}
func (*StepScript) ValidateJSON ¶ added in v1.1.0
func (s *StepScript) ValidateJSON(v *ejson.Validator)
type SubscribableConnector ¶
type SubscribableConnector interface {
Connector
Subscribe(pg.Conn, *SubscriptionContext) error
Unsubscribe(pg.Conn, *SubscriptionContext) error
}
type Subscription ¶
type Subscription struct {
Id Id
ProjectId *Id
JobId *Id
IdentityId *Id
Connector string
Event string
Parameters SubscriptionParameters
CreationTime time.Time
Status SubscriptionStatus
UpdateDelay int // seconds
LastUpdateTime *time.Time
NextUpdateTime *time.Time
}
func LoadSubscriptionForProcessing ¶
func LoadSubscriptionForProcessing(conn pg.Conn) (*Subscription, error)
func (*Subscription) EventDef ¶
func (s *Subscription) EventDef() *EventDef
func (*Subscription) LoadByJobForUpdate ¶
type SubscriptionContext ¶
type SubscriptionContext struct {
Subscription *Subscription
Identity *Identity
Job *Job
Scope Scope
}
func (*SubscriptionContext) Load ¶
func (sctx *SubscriptionContext) Load(conn pg.Conn, subscription *Subscription) error
type SubscriptionParameters ¶
type SubscriptionParameters interface {
ejson.Validatable
}
type SubscriptionStatus ¶
type SubscriptionStatus string
const ( SubscriptionStatusInactive SubscriptionStatus = "inactive" SubscriptionStatusActive SubscriptionStatus = "active" SubscriptionStatusTerminating SubscriptionStatus = "terminating" )
type Subscriptions ¶
type Subscriptions []*Subscription
func (*Subscriptions) AddFromRow ¶
func (ss *Subscriptions) AddFromRow(row pgx.Row) error
func (*Subscriptions) LoadAllForUpdate ¶
func (ss *Subscriptions) LoadAllForUpdate(conn pg.Conn, scope Scope) error
type Trigger ¶
type Trigger struct {
Event EventRef `json:"event"`
Parameters SubscriptionParameters `json:"-"`
RawParameters json.RawMessage `json:"parameters,omitempty"`
Identity string `json:"identity,omitempty"`
Filters Filters `json:"filters,omitempty"`
}
func (*Trigger) MarshalJSON ¶
func (*Trigger) UnmarshalJSON ¶
func (*Trigger) ValidateJSON ¶ added in v1.1.0
type UnknownAPIKeyError ¶
type UnknownAPIKeyError struct {
Id *Id
}
func (UnknownAPIKeyError) Error ¶
func (err UnknownAPIKeyError) Error() string
type UnknownAccountError ¶
type UnknownAccountError struct {
Id Id
}
func (UnknownAccountError) Error ¶
func (err UnknownAccountError) Error() string
type UnknownConnectorDefError ¶
type UnknownConnectorDefError struct {
Name string
}
func (UnknownConnectorDefError) Error ¶
func (err UnknownConnectorDefError) Error() string
type UnknownEventDefError ¶
func (UnknownEventDefError) Error ¶
func (err UnknownEventDefError) Error() string
type UnknownEventError ¶
type UnknownEventError struct {
Id Id
}
func (UnknownEventError) Error ¶
func (err UnknownEventError) Error() string
type UnknownIdentityDefError ¶
func (UnknownIdentityDefError) Error ¶
func (err UnknownIdentityDefError) Error() string
type UnknownIdentityError ¶
type UnknownIdentityError struct {
Id Id
}
func (UnknownIdentityError) Error ¶
func (err UnknownIdentityError) Error() string
type UnknownIdentityNameError ¶ added in v1.1.0
type UnknownIdentityNameError struct {
Name string
}
func (UnknownIdentityNameError) Error ¶ added in v1.1.0
func (err UnknownIdentityNameError) Error() string
type UnknownJobError ¶
type UnknownJobError struct {
Id Id
}
func (UnknownJobError) Error ¶
func (err UnknownJobError) Error() string
type UnknownJobExecutionError ¶
type UnknownJobExecutionError struct {
Id Id
}
func (UnknownJobExecutionError) Error ¶
func (err UnknownJobExecutionError) Error() string
type UnknownJobNameError ¶
type UnknownJobNameError struct {
Name string
}
func (UnknownJobNameError) Error ¶
func (err UnknownJobNameError) Error() string
type UnknownJobSubscriptionError ¶
type UnknownJobSubscriptionError struct {
JobId Id
}
func (UnknownJobSubscriptionError) Error ¶
func (err UnknownJobSubscriptionError) Error() string
type UnknownProjectError ¶
type UnknownProjectError struct {
Id Id
}
func (UnknownProjectError) Error ¶
func (err UnknownProjectError) Error() string
type UnknownProjectNameError ¶
type UnknownProjectNameError struct {
Name string
}
func (UnknownProjectNameError) Error ¶
func (err UnknownProjectNameError) Error() string
type UnknownSessionError ¶
type UnknownSessionError struct {
Id Id
}
func (UnknownSessionError) Error ¶
func (err UnknownSessionError) Error() string
type UnknownStepExecutionError ¶
type UnknownStepExecutionError struct {
Id Id
}
func (UnknownStepExecutionError) Error ¶
func (err UnknownStepExecutionError) Error() string
type UnknownSubscriptionError ¶
type UnknownSubscriptionError struct {
Id Id
}
func (UnknownSubscriptionError) Error ¶
func (err UnknownSubscriptionError) Error() string
type UnknownUsernameError ¶
type UnknownUsernameError struct {
Username string
}
func (UnknownUsernameError) Error ¶
func (err UnknownUsernameError) Error() string
type Worker ¶
type WorkerBehaviour ¶
type WorkerCfg ¶
type WorkerCfg struct {
Log *log.Logger `json:"-"`
Pg *pg.Client `json:"-"`
Behaviour WorkerBehaviour `json:"-"`
Disabled bool `json:"disabled"`
InitialDelay int `json:"initial_delay"` // millisecond
ErrorDelay int `json:"error_delay"` // millisecond
SleepDuration int `json:"sleep_duration"` // millisecond
NotificationChan chan<- interface{} `json:"-"`
StopChan <-chan struct{} `json:"-"`
Wg *sync.WaitGroup `json:"-"`
}
Source Files
¶
- account.go
- api_key.go
- check.go
- command_data.go
- connector.go
- connector_catalog.go
- connector_def.go
- crypto.go
- cursor.go
- event.go
- event_def.go
- event_ref.go
- execution_context.go
- favourite_job.go
- file_set.go
- filter.go
- id.go
- identity.go
- identity_data_def.go
- identity_def.go
- job.go
- job_execution.go
- job_execution_input.go
- job_metrics.go
- job_stats.go
- json.go
- metrics.go
- notification.go
- pagination.go
- parameter.go
- project.go
- project_notification_settings.go
- project_settings.go
- runner.go
- scope.go
- session.go
- shebang.go
- sorts.go
- step_execution.go
- subscription.go
- subscription_context.go
- subscription_parameters.go
- templates.go
- term.go
- time.go
- worker.go
Click to show internal directories.
Click to hide internal directories.