Documentation ¶
Index ¶
- Variables
- func NewEIAuthorizer(db *sql.DB, ei bridges.ExternalInitiator) *eiAuthorizer
- func NewExternalInitiatorManager(db *sqlx.DB, httpclient HTTPClient, lggr logger.Logger, cfg pg.QConfig) *externalInitiatorManager
- func ValidatedWebhookSpec(tomlString string, externalInitiatorManager ExternalInitiatorManager) (jb job.Job, err error)
- type Authorizer
- type AuthorizerConfig
- type Delegate
- func (d *Delegate) AfterJobCreated(jb job.Job)
- func (d *Delegate) BeforeJobCreated(spec job.Job)
- func (d *Delegate) BeforeJobDeleted(spec job.Job)
- func (d *Delegate) JobType() job.Type
- func (d *Delegate) OnDeleteJob(jb job.Job, q pg.Queryer) error
- func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) ([]job.ServiceCtx, error)
- func (d *Delegate) WebhookJobRunner() JobRunner
- type ExternalInitiatorManager
- type HTTPClient
- type JobRunner
- type JobSpecNotice
- type NullExternalInitiatorManager
- type TOMLWebhookSpec
- type TOMLWebhookSpecExternalInitiator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrJobNotExists = errors.New("job does not exist")
Functions ¶
func NewEIAuthorizer ¶
func NewEIAuthorizer(db *sql.DB, ei bridges.ExternalInitiator) *eiAuthorizer
func NewExternalInitiatorManager ¶
func NewExternalInitiatorManager(db *sqlx.DB, httpclient HTTPClient, lggr logger.Logger, cfg pg.QConfig) *externalInitiatorManager
NewExternalInitiatorManager returns the concrete externalInitiatorManager
func ValidatedWebhookSpec ¶
func ValidatedWebhookSpec(tomlString string, externalInitiatorManager ExternalInitiatorManager) (jb job.Job, err error)
Types ¶
type Authorizer ¶
type Authorizer interface {
CanRun(ctx context.Context, config AuthorizerConfig, jobUUID uuid.UUID) (bool, error)
}
func NewAuthorizer ¶
func NewAuthorizer(db *sql.DB, user *sessions.User, ei *bridges.ExternalInitiator) Authorizer
type AuthorizerConfig ¶
type AuthorizerConfig interface {
ExternalInitiatorsEnabled() bool
}
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
func (*Delegate) AfterJobCreated ¶
func (*Delegate) BeforeJobCreated ¶
func (*Delegate) BeforeJobDeleted ¶
func (*Delegate) ServicesForSpec ¶
ServicesForSpec satisfies the job.Delegate interface.
func (*Delegate) WebhookJobRunner ¶
type ExternalInitiatorManager ¶
type ExternalInitiatorManager interface { Notify(ctx context.Context, webhookSpecID int32) error DeleteJob(ctx context.Context, webhookSpecID int32) error FindExternalInitiatorByName(name string) (bridges.ExternalInitiator, error) }
ExternalInitiatorManager manages HTTP requests to remote external initiators
type JobSpecNotice ¶
type JobSpecNotice struct { JobID uuid.UUID `json:"jobId"` Type string `json:"type"` Params models.JSON `json:"params,omitempty"` }
JobSpecNotice is sent to the External Initiator when JobSpecs are created.
type NullExternalInitiatorManager ¶
type NullExternalInitiatorManager struct{}
func (NullExternalInitiatorManager) DeleteJob ¶
func (NullExternalInitiatorManager) DeleteJob(context.Context, int32) error
func (NullExternalInitiatorManager) FindExternalInitiatorByName ¶
func (NullExternalInitiatorManager) FindExternalInitiatorByName(name string) (bridges.ExternalInitiator, error)
type TOMLWebhookSpec ¶
type TOMLWebhookSpec struct {
ExternalInitiators []TOMLWebhookSpecExternalInitiator `toml:"externalInitiators"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.