service

package
v0.0.0-...-044f632 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTestCampaignNotFound  = errors.New("test campaign not found")
	ErrSpecificationNotFound = errors.New("specification not found")
	ErrPipelineNotFound      = errors.New("pipeline not found")
	ErrFlowNotFound          = errors.New("flow not found")
)

Functions

func WrapWithDatabaseError

func WrapWithDatabaseError(err error) error

func WrapWithParseError

func WrapWithParseError(err error) error

func WrapWithPublishCancelError

func WrapWithPublishCancelError(err error) error

func WrapWithSubscribeCancelError

func WrapWithSubscribeCancelError(err error) error

Types

type CancelSignal

type CancelSignal = struct{}

type DatabaseError

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

func (*DatabaseError) Error

func (e *DatabaseError) Error() string

func (*DatabaseError) Unwrap

func (e *DatabaseError) Unwrap() error

type DoneSignal

type DoneSignal struct{}

type EnqueueFunc

type EnqueueFunc func(fn func())

func (EnqueueFunc) Enqueue

func (e EnqueueFunc) Enqueue(fn func())

type Enqueuer

type Enqueuer interface {
	Enqueue(fn func())
}

type FlowRepository

type FlowRepository interface {
	GetFlow(ctx context.Context, flowID string) (*flow.Flow, error)
	UpsertFlow(ctx context.Context, flow *flow.Flow) error
}

type Logger

type Logger interface {
	With(args ...interface{}) Logger
	Named(name string) Logger
	Debug(msg string, args ...interface{})
	Info(msg string, args ...interface{})
	Warn(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Fatal(msg string, args ...interface{})
}

type ParseError

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

func (*ParseError) Error

func (e *ParseError) Error() string

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

type ParserOption

type ParserOption func(b *specification.Builder)

func WithSpecificationID

func WithSpecificationID(specID string) ParserOption

func WithSpecificationLoadedAt

func WithSpecificationLoadedAt(loadedAt time.Time) ParserOption

func WithSpecificationOwnerID

func WithSpecificationOwnerID(ownerID string) ParserOption

func WithSpecificationTestCampaignID

func WithSpecificationTestCampaignID(testCampaignID string) ParserOption

type PipelineCancelPublisher

type PipelineCancelPublisher interface {
	PublishPipelineCancel(pipeID string) error
}

type PipelineCancelSubscriber

type PipelineCancelSubscriber interface {
	SubscribePipelineCancel(pipeID string) (<-chan CancelSignal, error)
}

type PipelineGuard

type PipelineGuard interface {
	AcquirePipeline(ctx context.Context, pipeID string) error
	ReleasePipeline(ctx context.Context, pipeID string) error
}

type PipelineMaintainer

type PipelineMaintainer interface {
	MaintainPipeline(
		ctx context.Context,
		pipe *pipeline.Pipeline,
	) (<-chan DoneSignal, error)
}

func NewPipelineMaintainer

func NewPipelineMaintainer(
	guard PipelineGuard,
	cancelSub PipelineCancelSubscriber,
	policy PipelinePolicy,
	enqueuer Enqueuer,
	logger Logger,
	flowTimeout time.Duration,
) PipelineMaintainer

type PipelinePolicy

type PipelinePolicy interface {
	ConsumePipeline(
		ctx context.Context,
		pipe *pipeline.Pipeline,
	)
}

func NewSavePerStepPolicy

func NewSavePerStepPolicy(
	flowRepo FlowRepository,
	logger Logger,
	saveTimeout time.Duration,
) PipelinePolicy

type PipelineRepository

type PipelineRepository interface {
	GetPipeline(
		ctx context.Context,
		pipeID string,
		specGetter SpecificationGetter,
		registrars ...pipeline.ExecutorRegistrar,
	) (*pipeline.Pipeline, error)
	AddPipeline(ctx context.Context, pipe *pipeline.Pipeline) error
}

type PublishCancelError

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

func (*PublishCancelError) Error

func (e *PublishCancelError) Error() string

func (*PublishCancelError) Unwrap

func (e *PublishCancelError) Unwrap() error

type SpecificationGetter

type SpecificationGetter interface {
	GetSpecification(ctx context.Context, specID string) (*specification.Specification, error)
}

func AvailableSpecification

func AvailableSpecification(spec *specification.Specification) SpecificationGetter

func WithoutSpecification

func WithoutSpecification() SpecificationGetter

type SpecificationParser

type SpecificationParser interface {
	ParseSpecification(reader io.Reader, opts ...ParserOption) (*specification.Specification, error)
}

type SpecificationRepository

type SpecificationRepository interface {
	GetSpecification(ctx context.Context, specID string) (*specification.Specification, error)
	GetActiveSpecificationByTestCampaignID(
		ctx context.Context,
		testCampaignID string,
	) (*specification.Specification, error)
	AddSpecification(ctx context.Context, spec *specification.Specification) error
}

type SubscribeCancelError

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

func (*SubscribeCancelError) Error

func (e *SubscribeCancelError) Error() string

func (*SubscribeCancelError) Unwrap

func (e *SubscribeCancelError) Unwrap() error

type TestCampaignRepository

type TestCampaignRepository interface {
	GetTestCampaign(ctx context.Context, tcID string) (*testcampaign.TestCampaign, error)
	AddTestCampaign(ctx context.Context, tc *testcampaign.TestCampaign) error
	UpdateTestCampaign(ctx context.Context, tcID string, updater TestCampaignUpdater) error
}

type TestCampaignUpdater

type TestCampaignUpdater func(
	ctx context.Context,
	tc *testcampaign.TestCampaign,
) (*testcampaign.TestCampaign, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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