configbase

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 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" json:"version,omitempty,optional,default=v3"`
	Address                  string        `yaml:"address" json:"address"`
	User                     string        `yaml:"user,omitempty" json:"user,omitempty,optional"`
	Password                 string        `yaml:"password,omitempty" json:"password,omitempty,optional"`
	ConcurrencyPerAddress    int           `yaml:"concurrencyPerAddress,omitempty" json:"concurrencyPerAddress,omitempty,optional"`
	ReconnectInitialInterval time.Duration `yaml:"reconnectInitialInterval,omitempty" json:"reconnectInitialInterval,omitempty,optional,default=5000"`
	Retry                    int           `yaml:"retry,omitempty" json:"retry,omitempty,optional,default=3"`
	RetryInitialInterval     time.Duration `yaml:"retryInitialInterval,omitempty" json:"retryInitialInterval,omitempty,optional,default=5000"`
	SSL                      *SSL          `yaml:"ssl,omitempty" json:"ssl,omitempty,optional"`
}

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" json:"level,omitempty,optional"`
	Console *bool         `yaml:"console,omitempty" json:"console,omitempty,optional"`
	Files   []string      `yaml:"files,omitempty" json:"files,omitempty,optional"`
	Fields  logger.Fields `yaml:"fields,omitempty" json:"fields,omitempty,optional"`
}

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" json:"batch,omitempty,optional,default=100"`
	ReaderConcurrency   int           `yaml:"readerConcurrency,omitempty" json:"readerConcurrency,omitempty,optional,default=100"`
	ImporterConcurrency int           `yaml:"importerConcurrency,omitempty" json:"importerConcurrency,omitempty,optional,default=200"`
	StatsInterval       time.Duration `yaml:"statsInterval,omitempty" json:"statsInterval,omitempty,optional,default=10000000000"`
	Hooks               manager.Hooks `yaml:"hooks,omitempty" json:"hooks,omitempty,optional"`
}

type SSL

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

func (*SSL) BuildConfig

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

type Source

type Source struct {
	source.Config     `yaml:",inline" json:",inline"`
	Batch             int              `yaml:"batch,omitempty" json:"batch,omitempty,optional,default=200"`
	DatasourceId      *string          `yaml:"datasourceId,omitempty" json:"datasourceId,optional,omitempty"`
	DatasourceKeyFile *string          `yaml:"datasourceKeyFile,omitempty" json:"datasourceKeyFile,optional,omitempty"`
	Convert           string           `yaml:"convert,omitempty" json:"convert,optional,omitempty,default=none"`
	Convertor         reader.Convertor `yaml:"-" json:"-"`
}

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