conduit

package
v0.8.0-nightly.20231026 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 51 Imported by: 1

Documentation

Overview

Package conduit wires up everything under the hood of a Conduit instance including metrics, telemetry, logging, and server construction. It should only ever interact with the Orchestrator, never individual services. All of that responsibility should be left to the Orchestrator.

Index

Constants

View Source
const (
	DBTypeBadger   = "badger"
	DBTypePostgres = "postgres"
	DBTypeInMemory = "inmemory"
)

Variables

This section is empty.

Functions

func Serve added in v0.7.2

func Serve(cfg Config)

Serve is a shortcut for Entrypoint.Serve.

func Version

func Version(appendOSArch bool) string

Types

type Config

type Config struct {
	DB struct {
		// When Driver is specified it takes precedence over other DB related
		// fields.
		Driver database.DB

		Type   string
		Badger struct {
			Path string
		}
		Postgres struct {
			ConnectionString string
			Table            string
		}
	}

	API struct {
		Enabled bool

		HTTP struct {
			Address string
		}
		GRPC struct {
			Address string
		}
	}

	Log struct {
		Level  string
		Format string
	}

	Connectors struct {
		Path string
	}

	Pipelines struct {
		Path        string
		ExitOnError bool
	}

	PluginDispenserFactories map[string]builtin.DispenserFactory
	ProcessorBuilderRegistry *processor.BuilderRegistry
	// contains filtered or unexported fields
}

Config holds all configurable values for Conduit.

func DefaultConfig added in v0.7.2

func DefaultConfig() Config

func (Config) Validate

func (c Config) Validate() error

type Entrypoint added in v0.7.2

type Entrypoint struct{}

Entrypoint provides methods related to the Conduit entrypoint (parsing config, managing interrupt signals etc.).

func (*Entrypoint) CancelOnInterrupt added in v0.7.2

func (*Entrypoint) CancelOnInterrupt(ctx context.Context) context.Context

CancelOnInterrupt returns a context that is canceled when the interrupt signal is received. * After the first signal the function will continue to listen * On the second signal executes a hard exit, without waiting for a graceful shutdown.

func (*Entrypoint) Flags added in v0.7.2

func (*Entrypoint) Flags(cfg *Config) *flag.FlagSet

Flags returns a flag set that, when parsed, stores the values in the provided config struct.

func (*Entrypoint) ParseConfig added in v0.7.2

func (e *Entrypoint) ParseConfig(flags *flag.FlagSet)

func (*Entrypoint) Serve added in v0.7.2

func (e *Entrypoint) Serve(cfg Config)

Serve is the entrypoint for Conduit. It is a convenience function if you want to tweak the Conduit CLI and inject different default values or built-in plugins while retaining the same flags and exit behavior. You can adjust the default values by setting the corresponding field in Config. The default config can be retrieved with DefaultConfig. The config will be populated with values parsed from:

  • command line flags (highest priority)
  • environment variables
  • config file (lowest priority)

func (*Entrypoint) Splash added in v0.7.2

func (*Entrypoint) Splash() string

type Runtime

type Runtime struct {
	Config Config

	DB               database.DB
	Orchestrator     *orchestrator.Orchestrator
	ProvisionService *provisioning.Service
	// Ready will be closed when Runtime has successfully started
	Ready chan struct{}
	// contains filtered or unexported fields
}

Runtime sets up all services for serving and monitoring a Conduit instance.

func NewRuntime

func NewRuntime(cfg Config) (*Runtime, error)

NewRuntime sets up a Runtime instance and primes it for start.

func (*Runtime) Run

func (r *Runtime) Run(ctx context.Context) (err error)

Run initializes all of Conduit's underlying services and starts the GRPC and HTTP APIs. This function blocks until the supplied context is cancelled or one of the services experiences a fatal error.

Jump to

Keyboard shortcuts

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