Documentation ¶
Index ¶
- Variables
- func NewEIAuthorizer(db *gorm.DB, ei models.ExternalInitiator) *eiAuthorizer
- func NewExternalInitiatorManager(db *gorm.DB, httpclient HTTPClient) *externalInitiatorManager
- func ValidatedWebhookSpec(tomlString string, externalInitiatorManager ExternalInitiatorManager) (jb job.Job, err error)
- type Authorizer
- type AuthorizerConfig
- type Delegate
- type ExternalInitiatorManager
- type HTTPClient
- type JobRunner
- type JobSpecNotice
- type JobSpecNoticeV2
- type NullExternalInitiatorManager
- func (NullExternalInitiatorManager) DeleteJob(jobID models.JobID) error
- func (NullExternalInitiatorManager) DeleteJobV2(int32) error
- func (NullExternalInitiatorManager) FindExternalInitiatorByName(name string) (models.ExternalInitiator, error)
- func (NullExternalInitiatorManager) Notify(models.JobSpec) error
- func (NullExternalInitiatorManager) NotifyV2(int32) error
- type TOMLWebhookSpec
- type TOMLWebhookSpecExternalInitiator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrJobNotExists = errors.New("job does not exist")
View Source
var ErrMissingJobID = errors.New("missing job ID")
Functions ¶
func NewEIAuthorizer ¶ added in v0.10.11
func NewEIAuthorizer(db *gorm.DB, ei models.ExternalInitiator) *eiAuthorizer
func NewExternalInitiatorManager ¶
func NewExternalInitiatorManager(db *gorm.DB, httpclient HTTPClient) *externalInitiatorManager
NewExternalInitiatorManager returns the concrete externalInitiatorManager
func ValidatedWebhookSpec ¶
func ValidatedWebhookSpec(tomlString string, externalInitiatorManager ExternalInitiatorManager) (jb job.Job, err error)
Types ¶
type Authorizer ¶ added in v0.10.11
type Authorizer interface {
CanRun(ctx context.Context, config AuthorizerConfig, jobUUID uuid.UUID) (bool, error)
}
func NewAuthorizer ¶ added in v0.10.11
func NewAuthorizer(db *gorm.DB, user *models.User, ei *models.ExternalInitiator) Authorizer
type AuthorizerConfig ¶ added in v0.10.11
type AuthorizerConfig interface {
FeatureExternalInitiators() bool
}
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
func NewDelegate(runner pipeline.Runner, externalInitiatorManager ExternalInitiatorManager) *Delegate
func (*Delegate) AfterJobCreated ¶ added in v0.10.11
func (*Delegate) BeforeJobDeleted ¶ added in v0.10.11
func (*Delegate) ServicesForSpec ¶
func (*Delegate) WebhookJobRunner ¶
type ExternalInitiatorManager ¶
type ExternalInitiatorManager interface { Notify(models.JobSpec) error NotifyV2(webhookSpecID int32) error DeleteJob(jobID models.JobID) error DeleteJobV2(webhookSpecID int32) error FindExternalInitiatorByName(name string) (models.ExternalInitiator, error) }
ExternalInitiatorManager manages HTTP requests to remote external initiators
type HTTPClient ¶ added in v0.10.11
type JobSpecNotice ¶
type JobSpecNotice struct { JobID models.JobID `json:"jobId"` Type string `json:"type"` Params models.JSON `json:"params,omitempty"` }
JobSpecNotice is sent to the External Initiator when JobSpecs are created.
func NewJobSpecNotice ¶
NewJobSpecNotice returns a new JobSpec.
type JobSpecNoticeV2 ¶
type JobSpecNoticeV2 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(jobID models.JobID) error
func (NullExternalInitiatorManager) DeleteJobV2 ¶
func (NullExternalInitiatorManager) DeleteJobV2(int32) error
func (NullExternalInitiatorManager) FindExternalInitiatorByName ¶
func (NullExternalInitiatorManager) FindExternalInitiatorByName(name string) (models.ExternalInitiator, error)
func (NullExternalInitiatorManager) Notify ¶
func (NullExternalInitiatorManager) Notify(models.JobSpec) error
func (NullExternalInitiatorManager) NotifyV2 ¶
func (NullExternalInitiatorManager) NotifyV2(int32) error
type TOMLWebhookSpec ¶ added in v0.10.11
type TOMLWebhookSpec struct {
ExternalInitiators []TOMLWebhookSpecExternalInitiator `toml:"externalInitiators"`
}
type TOMLWebhookSpecExternalInitiator ¶ added in v0.10.11
Source Files ¶
Click to show internal directories.
Click to hide internal directories.