transientsource

package
v1.7.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// SourceIdsSupplier provides an up-to-date supplier of transient source ids
	SourceIdsSupplier() func() []string

	// Apply performs transient source_id filtering logic against a single source_id.
	// If it corresponds to a transient source_id, the result will be true, otherwise false.
	Apply(sourceId string) bool

	// ApplyJob performs transient source_id filtering logic against a single job.
	// If the job corresponds to a transient source_id, the result will be true, otherwise false.
	ApplyJob(job *jobsdb.JobT) bool

	// ApplyParams performs transient source_id filtering logic against a job's parameters.
	// If the parameters contain a transient source_id, the result will be true, otherwise false.
	ApplyParams(params json.RawMessage) bool
}

Service provides services related to transient source ids

func NewEmptyService

func NewEmptyService() Service

NewEmptyService creates a new service that operates against an empty list of transient source ids Useful for tests, when you are not interested in testing for transient sources.

func NewService

func NewService(ctx context.Context, config backendconfig.BackendConfig) Service

NewService creates a new service that updates its transient source ids while backend configuration gets updated.

func NewStaticService

func NewStaticService(sourceIds []string) Service

NewStaticService creates a new service that operates against a predefined list of transient source ids. Useful for tests.

Jump to

Keyboard shortcuts

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