backend

package
v0.0.0-...-6d75b34 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPublisher

NewPublisher initialize new Publisher

func NewRunner

func NewRunner(ps codefresh.PipelineService) model.Runner

NewRunner initialize new PipelineRunner

func NewSecretChecker

func NewSecretChecker() model.SecretChecker

NewSecretChecker initialize new SecretChecker

Types

type PipelineRunner

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

PipelineRunner runs Codefresh pipelines

func (*PipelineRunner) Run

func (r *PipelineRunner) Run(account string, pipelines []string, vars map[string]string, event model.NormalizedEvent) ([]model.PipelineRun, error)

Run Codefresh pipelines: return arrays of runs and errors

type Publisher

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

Publisher publish event to Codefresh eventbus

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, account string, eventURI string, event model.NormalizedEvent) error

Publish Codefresh pipelines: return arrays of runs and errors

type RedisEventGetter

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

RedisEventGetter implements GetEvent used internally in RedisStore

func (*RedisEventGetter) GetEvent

func (r *RedisEventGetter) GetEvent(ctx context.Context, event string) (*model.Event, error)

GetEvent get event by event URI

type RedisPool

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

RedisPool redis pool

func (*RedisPool) GetConn

func (rp *RedisPool) GetConn() redis.Conn

GetConn helper function: get Redis connection from pool; override in test

type RedisPoolService

type RedisPoolService interface {
	GetConn() redis.Conn
}

RedisPoolService interface for getting Redis connection from pool or test mock

type RedisStore

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

RedisStore in memory trigger map store

func NewRedisStore

func NewRedisStore(server string, port int, db int, password string, pipelineSvc codefresh.PipelineService, eventProvider provider.EventProvider) *RedisStore

NewRedisStore create new Redis DB for storing trigger map

func (*RedisStore) CreateEvent

func (r *RedisStore) CreateEvent(ctx context.Context, eventType, kind, secret, context string, values map[string]string) (*model.Event, error)

CreateEvent new trigger event

func (*RedisStore) CreateTrigger

func (r *RedisStore) CreateTrigger(ctx context.Context, event, pipeline string, filters map[string]string) error

CreateTrigger create trigger: link event <-> multiple pipelines

func (*RedisStore) DeleteAllTriggersByPipeline

func (r *RedisStore) DeleteAllTriggersByPipeline(ctx context.Context, pipeline string) error

func (*RedisStore) DeleteEvent

func (r *RedisStore) DeleteEvent(ctx context.Context, event, context string) error

DeleteEvent delete trigger event

func (*RedisStore) DeleteTrigger

func (r *RedisStore) DeleteTrigger(ctx context.Context, event, pipeline string) error

DeleteTrigger delete trigger: unlink event from pipeline

func (*RedisStore) GetEvent

func (r *RedisStore) GetEvent(ctx context.Context, event string) (*model.Event, error)

GetEvent get event by event URI

func (*RedisStore) GetEventTriggers

func (r *RedisStore) GetEventTriggers(ctx context.Context, event string) ([]model.Trigger, error)

GetEventTriggers get list of triggers for specified event

func (*RedisStore) GetEvents

func (r *RedisStore) GetEvents(ctx context.Context, eventType, kind, filter string) ([]model.Event, error)

GetEvents get events by event type, kind and filter (can be URI or part of URI)

func (*RedisStore) GetPipelineTriggers

func (r *RedisStore) GetPipelineTriggers(ctx context.Context, pipeline string, withEvent bool) ([]model.Trigger, error)

GetPipelineTriggers get list of defined triggers for specified pipeline

func (*RedisStore) GetTriggerPipelines

func (r *RedisStore) GetTriggerPipelines(ctx context.Context, event string, vars map[string]string) ([]string, error)

GetTriggerPipelines get pipelines that have trigger defined with filter applied can be filtered by event-uri(s)

func (*RedisStore) Ping

func (r *RedisStore) Ping() (string, error)

Ping Redis services

type SecretChecker

type SecretChecker struct {
}

SecretChecker checks secret or HMAC signature

func (*SecretChecker) Validate

func (s *SecretChecker) Validate(message string, secret string, key string) error

Validate secret or HMAC signature

Jump to

Keyboard shortcuts

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