Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 24 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CiPipelineMaterialResponse

type CiPipelineMaterialResponse struct {
	Id              int                    `json:"id"`
	GitMaterialId   int                    `json:"gitMaterialId"`
	GitMaterialUrl  string                 `json:"gitMaterialUrl"`
	GitMaterialName string                 `json:"gitMaterialName"`
	Type            string                 `json:"type"`
	Value           string                 `json:"value"`
	Active          bool                   `json:"active"`
	History         []*gitSensor.GitCommit `json:"history,omitempty"`
	LastFetchTime   time.Time              `json:"lastFetchTime"`
	IsRepoError     bool                   `json:"isRepoError"`
	RepoErrorMsg    string                 `json:"repoErrorMsg"`
	IsBranchError   bool                   `json:"isBranchError"`
	BranchErrorMsg  string                 `json:"branchErrorMsg"`
	Url             string                 `json:"url"`
}

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"`
	BaseUrl            string            `json:"baseUrl"`
	UserId             int               `json:"-"`
}

type EventClient

type EventClient interface {
	WriteNotificationEvent(event Event) (bool, error)
	WriteNatsEvent(channel string, payload interface{}) error
}

type EventClientConfig

type EventClientConfig struct {
	DestinationURL     string             `env:"EVENT_URL" envDefault:"http://localhost:3000/notify"`
	NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest"`
}

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 *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) *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) Build

func (impl *EventSimpleFactoryImpl) Build(eventType util.EventType, sourceId *int, appId int, envId *int, pipelineType util.PipelineType) (Event, error)

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 *MaterialTriggerInfo) Event

type MaterialTriggerInfo

type MaterialTriggerInfo struct {
	GitTriggers map[int]pipelineConfig.GitCommit `json:"gitTriggers"`
	CiMaterials []CiPipelineMaterialResponse     `json:"ciMaterials"`
}

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   *MaterialTriggerInfo `json:"material"`
	FailureReason         string               `json:"failureReason"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL