completions

package
v0.0.0-...-f96b470 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package completions initialises the completions event stream consumer and producer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProducerConsumer

func NewProducerConsumer(completionsProcessor Processor, opts ...Opts) (events.Producer[uuid.UUID], events.Consumer, error)

NewProducerConsumer creates a new producer and consumer.

Types

type ConsumerType

type ConsumerType string

ConsumerType represents the consumer type.

const (
	ConsumerTypeLocal ConsumerType = "local"
)

Different consumer types.

type Notifier

type Notifier interface {
	// SendCompletion sends a completion message.
	SendCompletion(ctx context.Context, projectRun *notifierDomain.ProjectRun) error
}

Notifier is a notifier which can send completions.

type Options

type Options struct {
	ConsumerType ConsumerType
}

Options represents the options.

type Opts

type Opts func(*Options)

Opts represents a function that modifies the options.

func WithConsumerType

func WithConsumerType(consumerType ConsumerType) Opts

WithConsumerType sets the consumer type.

type Processor

type Processor interface {
	// Process processes a run.
	Process(runID uuid.UUID) (uuid.UUID, error)
}

Processor processes runs.

func NewProcessor

func NewProcessor(
	completionNotifiers []notifiers.Notifier,
	runRepository repository.Run,
	projectRepository repository.Project,
) Processor

NewProcessor creates a new processor.

Jump to

Keyboard shortcuts

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