event

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 20 Imported by: 15

Documentation

Index

Constants

View Source
const DefaultPubSubKey = "events_pubsub"

Variables

This section is empty.

Functions

func Close

func Close(ctx context.Context)

Close closes event system

func DeleteEventIntegration

func DeleteEventIntegration(eventIntegrationID int64)

DeleteEventIntegration delete broker connection for this event integration

func DequeueEvent

func DequeueEvent(ctx context.Context, db *gorp.DbMap)

DequeueEvent runs in a goroutine and dequeue event from cache

func GetCDSName

func GetCDSName() string

GetCDSName returns cdsname of this cds instance

func GetEvents

func GetEvents(ctx context.Context, db gorp.SqlExecutor, store cache.Store, filters sdk.EventFilter) ([]json.RawMessage, error)

GetEvents retrieves events from elasticsearch

func GetHostname

func GetHostname() string

GetHostname returns Hostname of this cds instance

func Initialize

func Initialize(ctx context.Context, db *gorp.DbMap, cache Store, config *Config) error

Initialize initializes event system

func OverridePubSubKey

func OverridePubSubKey(key string)

func Publish

func Publish(ctx context.Context, payload interface{}, u sdk.Identifiable)

Publish sends a event to a queue

func PublishActionAdd

func PublishActionAdd(ctx context.Context, a sdk.Action, u sdk.Identifiable)

PublishActionAdd publishes an event for the creation of the given action.

func PublishActionUpdate

func PublishActionUpdate(ctx context.Context, oldAction sdk.Action, newAction sdk.Action, u sdk.Identifiable)

PublishActionUpdate publishes an event for the update of the given action.

func PublishAddApplication

func PublishAddApplication(ctx context.Context, projKey string, app sdk.Application, u sdk.Identifiable)

PublishAddApplication publishes an event for the creation of the given application

func PublishAddProject

func PublishAddProject(ctx context.Context, p *sdk.Project, u sdk.Identifiable)

PublishAddProject publishes an event for the creation of the given project

func PublishAddProjectIntegration

func PublishAddProjectIntegration(ctx context.Context, p *sdk.Project, pf sdk.ProjectIntegration, u sdk.Identifiable)

PublishAddProjectIntegration publishes an event on adding a integration

func PublishAddProjectKey

func PublishAddProjectKey(ctx context.Context, p *sdk.Project, k sdk.ProjectKey, u sdk.Identifiable)

PublishAddProjectKey publishes an event on adding a project key

func PublishAddProjectPermission

func PublishAddProjectPermission(ctx context.Context, p *sdk.Project, gp sdk.GroupPermission, u sdk.Identifiable)

PublishAddProjectPermission publishes an event on adding a group permission on the project

func PublishAddProjectRepository added in v0.53.0

func PublishAddProjectRepository(ctx context.Context, pKey string, vcs sdk.VCSProject, r sdk.ProjectRepository, u sdk.Identifiable)

func PublishAddProjectVariable

func PublishAddProjectVariable(ctx context.Context, p *sdk.Project, v sdk.ProjectVariable, u sdk.Identifiable)

PublishAddProjectVariable publishes an event for the creation of the given variable

func PublishAddVCSServer

func PublishAddVCSServer(ctx context.Context, p *sdk.Project, vcsServerName string, u sdk.Identifiable)

PublishAddVCSServer publishes an event on adding a project server

func PublishAddVariableApplication

func PublishAddVariableApplication(ctx context.Context, projKey string, app sdk.Application, v sdk.ApplicationVariable, u sdk.Identifiable)

PublishAddVariableApplication publishes an event when adding a new variable

func PublishApplicationKeyAdd

func PublishApplicationKeyAdd(ctx context.Context, projKey string, app sdk.Application, k sdk.ApplicationKey, u sdk.Identifiable)

func PublishApplicationKeyDelete

func PublishApplicationKeyDelete(ctx context.Context, projKey string, app sdk.Application, k sdk.ApplicationKey, u sdk.Identifiable)

func PublishApplicationRepositoryAdd

func PublishApplicationRepositoryAdd(ctx context.Context, projKey string, app sdk.Application, u sdk.Identifiable)

PublishApplicationRepositoryAdd publishes an envet when adding a repository to an application

func PublishApplicationRepositoryDelete

func PublishApplicationRepositoryDelete(ctx context.Context, projKey string, appName string, vcsServer string, repository string, u sdk.Identifiable)

PublishApplicationRepositoryDelete publishes an envet when deleting a repository from an application

func PublishAsCodeEvent

func PublishAsCodeEvent(ctx context.Context, projectKey, workflowName string, asCodeEvent sdk.AsCodeEvent, u sdk.Identifiable)

func PublishDeleteApplication

func PublishDeleteApplication(ctx context.Context, projKey string, app sdk.Application, u sdk.Identifiable)

PublishDeleteApplication publishes an event for the deletion of the given application

func PublishDeleteProject

func PublishDeleteProject(ctx context.Context, p *sdk.Project, u sdk.Identifiable)

PublishDeleteProject publishess an event for the deletion of the given project

func PublishDeleteProjectIntegration

func PublishDeleteProjectIntegration(ctx context.Context, p *sdk.Project, pf sdk.ProjectIntegration, u sdk.Identifiable)

PublishDeleteProjectIntegration publishes an event on deleting integration

func PublishDeleteProjectKey

func PublishDeleteProjectKey(ctx context.Context, p *sdk.Project, k sdk.ProjectKey, u sdk.Identifiable)

PublishDeleteProjectKey publishes an event on deleting a project key

func PublishDeleteProjectPermission

func PublishDeleteProjectPermission(ctx context.Context, p *sdk.Project, gp sdk.GroupPermission, u sdk.Identifiable)

PublishDeleteProjectPermission publishes an event on deleting a group permission on the project

func PublishDeleteProjectVariable

func PublishDeleteProjectVariable(ctx context.Context, p *sdk.Project, v sdk.ProjectVariable, u sdk.Identifiable)

PublishDeleteProjectVariable publishes an event on project variable deletion

func PublishDeleteVCSServer

func PublishDeleteVCSServer(ctx context.Context, p *sdk.Project, vcsServerName string, u sdk.Identifiable)

PublishDeleteVCSServer publishes an event on deleting a project server

func PublishDeleteVariableApplication

func PublishDeleteVariableApplication(ctx context.Context, projKey string, app sdk.Application, v sdk.ApplicationVariable, u sdk.Identifiable)

PublishDeleteVariableApplication publishes an event when deleting a new variable

func PublishDisableProjectKey added in v0.53.0

func PublishDisableProjectKey(ctx context.Context, p *sdk.Project, k sdk.ProjectKey, u sdk.Identifiable)

func PublishEnableProjectKey added in v0.53.0

func PublishEnableProjectKey(ctx context.Context, p *sdk.Project, k sdk.ProjectKey, u sdk.Identifiable)

func PublishEnvironmentAdd

func PublishEnvironmentAdd(ctx context.Context, projKey string, env sdk.Environment, u sdk.Identifiable)

PublishEnvironmentAdd publishes an event for the creation of the given environment

func PublishEnvironmentDelete

func PublishEnvironmentDelete(ctx context.Context, projKey string, env sdk.Environment, u sdk.Identifiable)

PublishEnvironmentDelete publishes an event for the deletion of the given Environment

func PublishEnvironmentKeyAdd

func PublishEnvironmentKeyAdd(ctx context.Context, projKey string, env sdk.Environment, k sdk.EnvironmentKey, u sdk.Identifiable)

PublishEnvironmentKeyAdd publishes an event when adding a key on the given environment

func PublishEnvironmentKeyDelete

func PublishEnvironmentKeyDelete(ctx context.Context, projKey string, env sdk.Environment, k sdk.EnvironmentKey, u sdk.Identifiable)

PublishEnvironmentKeyDelete publishes an event when deleting a key on the given environment

func PublishEnvironmentUpdate

func PublishEnvironmentUpdate(ctx context.Context, projKey string, env sdk.Environment, oldenv sdk.Environment, u sdk.Identifiable)

PublishEnvironmentUpdate publishes an event for the update of the given Environment

func PublishEnvironmentVariableAdd

func PublishEnvironmentVariableAdd(ctx context.Context, projKey string, env sdk.Environment, v sdk.EnvironmentVariable, u sdk.Identifiable)

PublishEnvironmentVariableAdd publishes an event when adding a new variable

func PublishEnvironmentVariableDelete

func PublishEnvironmentVariableDelete(ctx context.Context, projKey string, env sdk.Environment, v sdk.EnvironmentVariable, u sdk.Identifiable)

PublishEnvironmentVariableDelete publishes an event when deleting a new variable

func PublishEnvironmentVariableUpdate

func PublishEnvironmentVariableUpdate(ctx context.Context, projKey string, env sdk.Environment, v sdk.EnvironmentVariable, vOld sdk.EnvironmentVariable, u sdk.Identifiable)

PublishEnvironmentVariableUpdate publishes an event when updating a variable

func PublishEventJobSummary added in v0.52.0

func PublishEventJobSummary(ctx context.Context, e sdk.EventJobSummary, integrations []sdk.WorkflowProjectIntegration)

func PublishMaintenanceEvent

func PublishMaintenanceEvent(ctx context.Context, payload interface{})

PublishMaintenanceEvent publish maintenance event

func PublishOperation

func PublishOperation(ctx context.Context, projectKey string, o sdk.Operation, u sdk.Identifiable)

PublishOperation publish operation event.

func PublishPipelineAdd

func PublishPipelineAdd(ctx context.Context, key string, pip sdk.Pipeline, u sdk.Identifiable)

PublishPipelineAdd publishes an event for the creation of the given pipeline

func PublishPipelineDelete

func PublishPipelineDelete(ctx context.Context, key string, pip sdk.Pipeline, u sdk.Identifiable)

PublishPipelineDelete publishes an event for the deletion of the pipeline

func PublishPipelineJobAdd

func PublishPipelineJobAdd(ctx context.Context, key string, pipName string, s sdk.Stage, j sdk.Job, u sdk.Identifiable)

PublishPipelineJobAdd publishes an event on adding a job

func PublishPipelineJobDelete

func PublishPipelineJobDelete(ctx context.Context, key string, pipName string, s sdk.Stage, j sdk.Job, u sdk.Identifiable)

PublishPipelineJobDelete publishes an event on deleting a job

func PublishPipelineJobUpdate

func PublishPipelineJobUpdate(ctx context.Context, key string, pipName string, s sdk.Stage, oldJob sdk.Job, newJob sdk.Job, u sdk.Identifiable)

PublishPipelineJobUpdate publishes an event on updating a job

func PublishPipelineParameterAdd

func PublishPipelineParameterAdd(ctx context.Context, key string, pipName string, p sdk.Parameter, u sdk.Identifiable)

PublishPipelineParameterAdd publishes an event on adding a pipeline parameter

func PublishPipelineParameterDelete

func PublishPipelineParameterDelete(ctx context.Context, key string, pipName string, p sdk.Parameter, u sdk.Identifiable)

PublishPipelineParameterDelete publishes an event on deleting a pipeline parameter

func PublishPipelineParameterUpdate

func PublishPipelineParameterUpdate(ctx context.Context, key string, pipName string, oldP sdk.Parameter, p sdk.Parameter, u sdk.Identifiable)

PublishPipelineParameterUpdate publishes an event on editing a pipeline parameter

func PublishPipelineStageAdd

func PublishPipelineStageAdd(ctx context.Context, key string, pipName string, s sdk.Stage, u sdk.Identifiable)

PublishPipelineStageAdd publishes an event on adding a stage

func PublishPipelineStageDelete

func PublishPipelineStageDelete(ctx context.Context, key string, pipName string, s sdk.Stage, u sdk.Identifiable)

PublishPipelineStageDelete publishes an event on deleting a stage

func PublishPipelineStageMove

func PublishPipelineStageMove(ctx context.Context, key string, pipName string, s sdk.Stage, oldBuildOrder int, u sdk.Identifiable)

PublishPipelineStageMove publishes an event on moving a stage

func PublishPipelineStageUpdate

func PublishPipelineStageUpdate(ctx context.Context, key string, pipName string, oldStage sdk.Stage, newStage sdk.Stage, u sdk.Identifiable)

PublishPipelineStageUpdate publishes an event on updating a stage

func PublishPipelineUpdate

func PublishPipelineUpdate(ctx context.Context, key string, newName string, oldName string, u sdk.Identifiable)

PublishPipelineUpdate publishes an event for the modification of the pipeline

func PublishProjectEvent

func PublishProjectEvent(ctx context.Context, payload interface{}, key string, u sdk.Identifiable)

PublishProjectEvent publish application event

func PublishRemoveProjectRepository added in v0.53.0

func PublishRemoveProjectRepository(ctx context.Context, pKey string, vcs sdk.VCSProject, r sdk.ProjectRepository, u sdk.Identifiable)

func PublishUpdateApplication

func PublishUpdateApplication(ctx context.Context, projKey string, app sdk.Application, oldApp sdk.Application, u sdk.Identifiable)

PublishUpdateApplication publishes an event for the update of the given application

func PublishUpdateProject

func PublishUpdateProject(ctx context.Context, p *sdk.Project, oldProject *sdk.Project, u sdk.Identifiable)

PublishUpdateProject publishes an event for the modification of the project

func PublishUpdateProjectIntegration

func PublishUpdateProjectIntegration(ctx context.Context, p *sdk.Project, pf sdk.ProjectIntegration, pfOld sdk.ProjectIntegration, u sdk.Identifiable)

PublishUpdateProjectIntegration publishes an event on updating a integration

func PublishUpdateProjectPermission

func PublishUpdateProjectPermission(ctx context.Context, p *sdk.Project, gp sdk.GroupPermission, oldGP sdk.GroupPermission, u sdk.Identifiable)

PublishUpdateProjectPermission publishes an event on updating a group permission on the project

func PublishUpdateProjectVariable

func PublishUpdateProjectVariable(ctx context.Context, p *sdk.Project, newVar sdk.ProjectVariable, oldVar sdk.ProjectVariable, u sdk.Identifiable)

PublishUpdateProjectVariable publishes an event for the modification of a variable

func PublishUpdateVariableApplication

func PublishUpdateVariableApplication(ctx context.Context, projKey string, app sdk.Application, v sdk.ApplicationVariable, vOld sdk.ApplicationVariable, u sdk.Identifiable)

PublishUpdateVariableApplication publishes an event when updating a variable

func PublishWorkflowAdd

func PublishWorkflowAdd(ctx context.Context, projKey string, w sdk.Workflow, u sdk.Identifiable)

PublishWorkflowAdd publishes an event for the creation of the given Workflow

func PublishWorkflowDelete

func PublishWorkflowDelete(ctx context.Context, projKey string, w sdk.Workflow, u sdk.Identifiable)

PublishWorkflowDelete publishes an event for the deletion of the given Workflow

func PublishWorkflowNodeJobRun

func PublishWorkflowNodeJobRun(ctx context.Context, pkey string, wr sdk.WorkflowRun, jr sdk.WorkflowNodeJobRun)

PublishWorkflowNodeJobRun publish a WorkflowNodeJobRun

func PublishWorkflowNodeRun

func PublishWorkflowNodeRun(ctx context.Context, nr sdk.WorkflowNodeRun, w sdk.Workflow, userWorkflowEvent []sdk.EventNotif)

PublishWorkflowNodeRun publish event on a workflow node run

func PublishWorkflowPermissionAdd

func PublishWorkflowPermissionAdd(ctx context.Context, projKey string, w sdk.Workflow, gp sdk.GroupPermission, u sdk.Identifiable)

PublishWorkflowPermissionAdd publishes an event when adding a permission on a workflow

func PublishWorkflowPermissionDelete

func PublishWorkflowPermissionDelete(ctx context.Context, projKey string, w sdk.Workflow, gp sdk.GroupPermission, u sdk.Identifiable)

PublishWorkflowPermissionDelete publishes an event when deleting a permission on a workflow

func PublishWorkflowPermissionUpdate

func PublishWorkflowPermissionUpdate(ctx context.Context, projKey string, w sdk.Workflow, gp sdk.GroupPermission, gpOld sdk.GroupPermission, u sdk.Identifiable)

PublishWorkflowPermissionUpdate publishes an event when updating a permission on a workflow

func PublishWorkflowRetentionDryRun

func PublishWorkflowRetentionDryRun(ctx context.Context, projKey string, workflowName string, status string, error string, warnings []string, runsToKeep []sdk.WorkflowRunToKeep, nbRunsAnalyzed int64, u sdk.Identifiable)

func PublishWorkflowRun

func PublishWorkflowRun(ctx context.Context, wr sdk.WorkflowRun, projectKey string)

PublishWorkflowRun publish event on a workflow run

func PublishWorkflowUpdate

func PublishWorkflowUpdate(ctx context.Context, projKey string, w sdk.Workflow, oldw sdk.Workflow, u sdk.Identifiable)

PublishWorkflowUpdate publishes an event for the update of the given Workflow

func PushInElasticSearch

func PushInElasticSearch(ctx context.Context, db gorp.SqlExecutor, store cache.Store)

PushInElasticSearch pushes event to an elasticsearch

func ResetEventIntegration

func ResetEventIntegration(ctx context.Context, db gorp.SqlExecutor, eventIntegrationID int64) error

ResetEventIntegration reset event integration in order to kill existing connection and add/check the new one

func Status

Status returns Event status

func Subscribe

func Subscribe(ch chan<- sdk.Event)

Subscribe to CDS events

Types

type Broker

type Broker interface {
	// contains filtered or unexported methods
}

Broker event typed

type Config added in v0.52.0

type Config struct {
	GlobalKafka     event.KafkaConfig `toml:"globalKafka" json:"globalKafka" mapstructure:"globalKafka"`
	JobSummaryKafka event.KafkaConfig `toml:"jobSummaryKafka" json:"jobSummaryKafka" mapstructure:"jobSummaryKafka"`
}

type KafkaClient

type KafkaClient struct {
	// contains filtered or unexported fields
}

KafkaClient enbeddes the Kafka connecion

type Store

type Store interface {
	cache.PubSubStore
	cache.QueueStore
}

Jump to

Keyboard shortcuts

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