Documentation
¶
Index ¶
- type Event
- type EventClient
- type EventClientConfig
- type EventFactory
- type EventRESTClientImpl
- type EventSimpleFactoryImpl
- func (impl *EventSimpleFactoryImpl) Build(eventType util.EventType, sourceId *int, appId int, envId *int, ...) (Event, error)
- func (impl *EventSimpleFactoryImpl) BuildExtraCDData(event Event, wfr *pipelineConfig.CdWorkflowRunner, pipelineOverrideId int, ...) Event
- func (impl *EventSimpleFactoryImpl) BuildExtraCIData(event Event, material *buildBean.MaterialTriggerInfo) Event
- type NotificationMedium
- type Payload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
EventTypeId int `json:"eventTypeId"`
EventName string `json:"eventName"`
PipelineId int `json:"pipelineId"`
PipelineType string `json:"pipelineType"`
CorrelationId string `json:"correlationId"`
Payload *Payload `json:"payload"`
EventTime string `json:"eventTime"`
TeamId int `json:"teamId"`
AppId int `json:"appId"`
EnvId int `json:"envId"`
IsProdEnv bool `json:"isProdEnv"`
ClusterId int `json:"clusterId"`
CdWorkflowType bean.WorkflowType `json:"cdWorkflowType,omitempty"`
CdWorkflowRunnerId int `json:"cdWorkflowRunnerId"`
CiWorkflowRunnerId int `json:"ciWorkflowRunnerId"`
CiArtifactId int `json:"ciArtifactId"`
EnvIdsForCiPipeline []int `json:"envIdsForCiPipeline"`
BaseUrl string `json:"baseUrl"`
UserId int `json:"-"`
}
type EventClient ¶
type EventClientConfig ¶
type EventClientConfig struct {
DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify" description:"Notifier service url"`
NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest" description:"notification medium"`
}
func GetEventClientConfig ¶
func GetEventClientConfig() (*EventClientConfig, error)
type EventFactory ¶
type EventFactory interface {
Build(eventType util.EventType, sourceId *int, appId int, envId *int, pipelineType util.PipelineType) (Event, error)
BuildExtraCDData(event Event, wfr *pipelineConfig.CdWorkflowRunner, pipelineOverrideId int, stage bean2.WorkflowType) Event
BuildExtraCIData(event Event, material *buildBean.MaterialTriggerInfo) Event
}
type EventRESTClientImpl ¶
type EventRESTClientImpl struct {
// contains filtered or unexported fields
}
func NewEventRESTClientImpl ¶
func NewEventRESTClientImpl(logger *zap.SugaredLogger, client *http.Client, config *EventClientConfig, pubsubClient *pubsub.PubSubClientServiceImpl, ciPipelineRepository pipelineConfig.CiPipelineRepository, pipelineRepository pipelineConfig.PipelineRepository, attributesRepository repository.AttributesRepository, moduleService module.ModuleService, notificationSettingsRepository repository.NotificationSettingsRepository) *EventRESTClientImpl
func (*EventRESTClientImpl) WriteNatsEvent ¶
func (impl *EventRESTClientImpl) WriteNatsEvent(topic string, payload interface{}) error
func (*EventRESTClientImpl) WriteNotificationEvent ¶ added in v0.6.0
func (impl *EventRESTClientImpl) WriteNotificationEvent(event Event) (bool, error)
type EventSimpleFactoryImpl ¶
type EventSimpleFactoryImpl struct {
// contains filtered or unexported fields
}
func NewEventSimpleFactoryImpl ¶
func NewEventSimpleFactoryImpl(logger *zap.SugaredLogger, cdWorkflowRepository pipelineConfig.CdWorkflowRepository, pipelineOverrideRepository chartConfig.PipelineOverrideRepository, ciWorkflowRepository pipelineConfig.CiWorkflowRepository, ciPipelineMaterialRepository pipelineConfig.CiPipelineMaterialRepository, ciPipelineRepository pipelineConfig.CiPipelineRepository, pipelineRepository pipelineConfig.PipelineRepository, userRepository repository.UserRepository, envRepository repository4.EnvironmentRepository, ciArtifactRepository repository2.CiArtifactRepository) *EventSimpleFactoryImpl
func (*EventSimpleFactoryImpl) BuildExtraCDData ¶
func (impl *EventSimpleFactoryImpl) BuildExtraCDData(event Event, wfr *pipelineConfig.CdWorkflowRunner, pipelineOverrideId int, stage bean2.WorkflowType) Event
func (*EventSimpleFactoryImpl) BuildExtraCIData ¶
func (impl *EventSimpleFactoryImpl) BuildExtraCIData(event Event, material *buildBean.MaterialTriggerInfo) Event
type NotificationMedium ¶ added in v0.7.1
type NotificationMedium string
const PUB_SUB NotificationMedium = "nats"
type Payload ¶
type Payload struct {
AppName string `json:"appName"`
EnvName string `json:"envName"`
PipelineName string `json:"pipelineName"`
Source string `json:"source"`
DockerImageUrl string `json:"dockerImageUrl"`
TriggeredBy string `json:"triggeredBy"`
Stage string `json:"stage"`
DeploymentHistoryLink string `json:"deploymentHistoryLink"`
AppDetailLink string `json:"appDetailLink"`
DownloadLink string `json:"downloadLink"`
BuildHistoryLink string `json:"buildHistoryLink"`
MaterialTriggerInfo *buildBean.MaterialTriggerInfo `json:"material"`
FailureReason string `json:"failureReason"`
}
Click to show internal directories.
Click to hide internal directories.