config

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvLogLevel = "LOG_LEVEL"
	EnvTarget   = "CONNECTOR_TARGET"
	EnvPort     = "CONNECTOR_PORT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StoreConfig StoreConfig `json:"store_config" yaml:"store_config"`
	LogConfig   LogConfig   `json:"log_config" yaml:"log_config"`
}

func (*Config) GetLogConfig

func (c *Config) GetLogConfig() LogConfig

func (*Config) GetSecret

func (c *Config) GetSecret() SecretAccessor

func (*Config) GetStoreConfig

func (c *Config) GetStoreConfig() StoreConfig

func (*Config) Validate

func (c *Config) Validate() error

type ConfigAccessor

type ConfigAccessor interface {
	ConnectorKind() Kind
	Validate() error
	// GetSecret SecretAccessor implement type must be pointer
	GetSecret() SecretAccessor

	GetLogConfig() LogConfig
	GetStoreConfig() StoreConfig
}

type Kind added in v0.6.0

type Kind string
const (
	SinkConnector   Kind = "sink"
	SourceConnector Kind = "source"
)

type LogConfig

type LogConfig struct {
	LogLevel string `json:"log_level" yaml:"log_level"`
}

func (LogConfig) GetLogLevel

func (c LogConfig) GetLogLevel() string

type SecretAccessor

type SecretAccessor interface{}

type SinkConfig

type SinkConfig struct {
	Config   `json:",inline" yaml:",inline"`
	Port     int `json:"port" yaml:"port"`
	GRPCPort int `json:"grpc_port" yaml:"grpc_port"`
}

func (*SinkConfig) ConnectorKind added in v0.6.0

func (c *SinkConfig) ConnectorKind() Kind

func (*SinkConfig) GetGRPCPort

func (c *SinkConfig) GetGRPCPort() int

func (*SinkConfig) GetPort

func (c *SinkConfig) GetPort() int

func (*SinkConfig) GetSecret

func (c *SinkConfig) GetSecret() SecretAccessor

func (*SinkConfig) Validate

func (c *SinkConfig) Validate() error

type SinkConfigAccessor

type SinkConfigAccessor interface {
	ConfigAccessor
	// GetPort receive event server use port, default 8080
	GetPort() int
	GetGRPCPort() int
}

type SourceConfig

type SourceConfig struct {
	Config            `json:",inline" yaml:",inline"`
	Target            string       `json:"target" yaml:"target"`
	SendEventAttempts *int         `json:"send_event_attempts" yaml:"send_event_attempts"`
	Vanus             *VanusConfig `json:"vanus" yaml:"vanus"`
	BatchSize         int          `json:"batch_size" yaml:"batch_size"`
}

func (*SourceConfig) ConnectorKind added in v0.6.0

func (c *SourceConfig) ConnectorKind() Kind

func (*SourceConfig) GetAttempts

func (c *SourceConfig) GetAttempts() int

func (*SourceConfig) GetBatchSize

func (c *SourceConfig) GetBatchSize() int

func (*SourceConfig) GetTarget

func (c *SourceConfig) GetTarget() string

func (*SourceConfig) GetVanusConfig

func (c *SourceConfig) GetVanusConfig() *VanusConfig

func (*SourceConfig) Validate

func (c *SourceConfig) Validate() error

type SourceConfigAccessor

type SourceConfigAccessor interface {
	ConfigAccessor
	GetTarget() string
	// GetAttempts send event max attempts, 0 will retry util success, default is 3.
	GetAttempts() int
	GetVanusConfig() *VanusConfig
	GetBatchSize() int
}

type StoreConfig

type StoreConfig struct {
	Type StoreType `json:"type" yaml:"type"`
	// file store
	StoreFile string `json:"store_file" yaml:"store_file"`
	// etcd store
	Endpoints []string `json:"endpoints" yaml:"endpoints"`
	KeyPrefix string   `json:"key_prefix" yaml:"key_prefix"`
}

func (*StoreConfig) Validate

func (c *StoreConfig) Validate() error

type StoreType

type StoreType string
const (
	MemoryStore StoreType = "memory"
	FileStore   StoreType = "file"
	EtcdStore   StoreType = "etcd"
)

type VanusConfig

type VanusConfig struct {
	Endpoint string `json:"endpoint" yaml:"endpoint" validate:"require"`
	Eventbus string `json:"eventbus" yaml:"eventbus" validate:"require"`
}

Jump to

Keyboard shortcuts

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