pipe

package
v0.1.48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipe

type Pipe struct {
	// Name contains the pipe name
	Name string
	// TagsCond contains the condition for selecting partitions for the pipe
	TagsCond string
	// FltCond contains the condition for filtering records from the partitions provided.
	FltCond string
}

Pipe struct describes a pipe.

func (Pipe) String

func (p Pipe) String() string

type PipeDesc

type PipeDesc struct {
	Pipe

	// DestTags contains the destination tag set.
	DestTags tag.Set
}

PipeDesc struct describes a pipe

type PipesConfig

type PipesConfig struct {
	// Dir contains the directory where pipes information is persisted
	Dir string

	// Ensure contains slice of pipes to be created on initialization stage
	EnsureAtStart []Pipe
}

PipesConfig is a configuration struct used for starting the service

func (*PipesConfig) Apply

func (pc *PipesConfig) Apply(other *PipesConfig)

func (PipesConfig) String

func (pc PipesConfig) String() string

type Service

type Service struct {
	CurProvider cursor.Provider   `inject:""`
	Journals    *journal2.Service `inject:""`
	Config      *PipesConfig      `inject:""`
	// contains filtered or unexported fields
}

Service struct provides functionality by managing pipes

func NewService

func NewService() *Service

NewService creates new pipe Service instance

func (*Service) CreatePipe

func (s *Service) CreatePipe(p Pipe) (PipeDesc, error)

CreatePipe creates new pipe by name and conditions provided. Returns an error if the pipe already exists or conditions could not be parsed. No error means the pipe is created successfully with parameters provided.

func (*Service) DeletePipe

func (s *Service) DeletePipe(name string) error

DeletePipe deletes the pipe by its name, but it doesn't delete the corresponding partition. The pipe's partition must be deleted via partition.Truncate method

func (*Service) EnsurePipe

func (s *Service) EnsurePipe(p Pipe) (PipeDesc, error)

EnsurePipe checks whether the pipe exists. It will create the new one if it does not exist. The function will return an error if there is a pipe with the name provided, but with another settings, than p

func (*Service) GetPipe

func (s *Service) GetPipe(name string) (PipeDesc, error)

GetPipe returns an existing pipe by its name

func (*Service) GetPipes

func (s *Service) GetPipes() []Pipe

GetPipes returns the list of known pipes, sorted by name

func (*Service) Init

func (s *Service) Init(ctx context.Context) error

Init provides an implementaion of linker.Initializer interface

func (*Service) Shutdown

func (s *Service) Shutdown()

Shutdown provides implementation for linker.Shutdowner interface

Jump to

Keyboard shortcuts

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