configbase

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientVersion3       = "v3"
	ClientVersionDefault = ClientVersion3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Version                  string        `yaml:"version"`
	Address                  string        `yaml:"address"`
	User                     string        `yaml:"user,omitempty"`
	Password                 string        `yaml:"password,omitempty"`
	ConcurrencyPerAddress    int           `yaml:"concurrencyPerAddress,omitempty"`
	ReconnectInitialInterval time.Duration `yaml:"reconnectInitialInterval,omitempty"`
	Retry                    int           `yaml:"retry,omitempty"`
	RetryInitialInterval     time.Duration `yaml:"retryInitialInterval,omitempty"`
	SSL                      *SSL          `yaml:"ssl,omitempty"`
}

func (*Client) BuildClientPool

func (c *Client) BuildClientPool(opts ...client.Option) (client.Pool, error)

func (*Client) OptimizePath

func (c *Client) OptimizePath(configPath string) error

OptimizePath optimizes relative paths base to the configuration file path

type Configurator

type Configurator interface {
	Optimize(configPath string) error
	Build() error
	GetLogger() logger.Logger
	GetClientPool() client.Pool
	GetManager() manager.Manager
}

type Log

type Log struct {
	Level   *string       `yaml:"level,omitempty"`
	Console *bool         `yaml:"console,omitempty"`
	Files   []string      `yaml:"files,omitempty"`
	Fields  logger.Fields `yaml:"fields,omitempty"`
}

func (*Log) BuildLogger

func (l *Log) BuildLogger(opts ...logger.Option) (logger.Logger, error)

func (*Log) OptimizePath

func (l *Log) OptimizePath(configPath string) error

OptimizePath optimizes relative paths base to the configuration file path

type Manager

type Manager struct {
	Batch               int           `yaml:"batch,omitempty"`
	ReaderConcurrency   int           `yaml:"readerConcurrency,omitempty"`
	ImporterConcurrency int           `yaml:"importerConcurrency,omitempty"`
	StatsInterval       time.Duration `yaml:"statsInterval,omitempty"`
	Hooks               manager.Hooks `yaml:"hooks,omitempty"`
}

type SSL

type SSL struct {
	Enable             bool   `yaml:"enable,omitempty"`
	CertPath           string `yaml:"certPath,omitempty"`
	KeyPath            string `yaml:"keyPath,omitempty"`
	CAPath             string `yaml:"caPath,omitempty"`
	InsecureSkipVerify bool   `yaml:"insecureSkipVerify,omitempty"`
}

func (*SSL) BuildConfig

func (s *SSL) BuildConfig() (*tls.Config, error)

type Source

type Source struct {
	SourceConfig source.Config `yaml:",inline"`
	Batch        int           `yaml:"batch,omitempty"`
}

func (*Source) BuildSourceAndReader

func (s *Source) BuildSourceAndReader(opts ...reader.Option) (
	source.Source,
	reader.BatchRecordReader,
	error,
)

func (*Source) Glob

func (s *Source) Glob() ([]*Source, bool, error)

Jump to

Keyboard shortcuts

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