config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// default app port.
	DefaultAppPort = 6789
	// default app id.
	DefaultAppID = "core"
	// assume single node.
	DefaultName = "core"
)

Variables

This section is empty.

Functions

func Init added in v0.3.1

func Init(cfgFile string)

func SetDefaultES added in v0.4.1

func SetDefaultES(esBrokers []string)

func SetDefaultEtcd added in v0.4.1

func SetDefaultEtcd(etcdBrokers []string)

func SetEtcdBrokers added in v0.3.1

func SetEtcdBrokers(brokers []string)

func SetSearchEngineElasticsearchConfig added in v0.3.1

func SetSearchEngineElasticsearchConfig(username, password string, urls []string)

func SetSearchEngineUseDrive added in v0.3.1

func SetSearchEngineUseDrive(drive string)

Types

type BatchQueue

type BatchQueue struct {
	Name string `yaml:"name" mapstructure:"name"`
	// BatchingMaxMessages set the maximum number of messages permitted in a batch. (default: 1000).
	MaxBatching int `yaml:"max_batching" mapstructure:"max_batching"`
	// MaxPendingMessages set the max size of the queue.
	MaxPendingMessages uint `yaml:"max_pending_messages" mapstructure:"max_pending_messages"`
	// BatchingMaxFlushDelay set the time period within which the messages sent will be batched (default: 10ms).
	BatchingMaxFlushDelay time.Duration `yaml:"batching_max_flush_delay" mapstructure:"batching_max_flush_delay"`
}

type Components added in v0.4.1

type Components struct {
	Etcd         EtcdConfig   `yaml:"etcd" mapstructure:"etcd"`
	Store        Metadata     `yaml:"store" mapstructure:"store"`
	TimeSeries   Metadata     `yaml:"time_series" mapstructure:"time_series"`
	SearchEngine SearchEngine `yaml:"search_engine" mapstructure:"search_engine"`
}

type Configuration added in v0.3.1

type Configuration struct {
	Proxy      Proxy          `yaml:"proxy" mapstructure:"proxy"`
	Server     Server         `yaml:"server" mapstructure:"server"`
	Logger     LogConfig      `yaml:"logger" mapstructure:"logger"`
	Discovery  Discovery      `yaml:"discovery" mapstructure:"discovery"`
	Components Components     `yaml:"components" mapstructure:"components"`
	Dispatcher DispatchConfig `yaml:"dispatcher" mapstructure:"dispatcher"`
}

func Get added in v0.3.1

func Get() Configuration

type Discovery added in v0.4.1

type Discovery struct {
	Endpoints   []string `yaml:"endpoints"`
	HeartTime   int64    `yaml:"heart_time"`
	DialTimeout int64    `yaml:"dial_timeout"`
}

type DispatchConfig added in v0.4.1

type DispatchConfig struct {
	ID      string        `yaml:"id" mapstructure:"id"`
	Name    string        `yaml:"name" mapstructure:"name"`
	Enabled bool          `yaml:"enabled" mapstructure:"enabled"`
	Queues  []QueueConfig `yaml:"queues" mapstructure:"queues"`
}

type ESConfig added in v0.3.1

type ESConfig struct {
	Endpoints []string `yaml:"endpoints"`
	Username  string   `yaml:"username"`
	Password  string   `yaml:"password"`
}

type EtcdConfig added in v0.3.0

type EtcdConfig struct {
	Endpoints   []string `yaml:"endpoints"`
	DialTimeout int64    `yaml:"dial_timeout"`
}

type LogConfig

type LogConfig struct {
	Dev      bool     `yaml:"dev"`
	Level    string   `yaml:"level"`
	Output   []string `yaml:"output"`
	Encoding string   `yaml:"encoding"`
}

type Metadata added in v0.3.0

type Metadata struct {
	Name       string `yaml:"name"`
	Properties []Pair `yaml:"properties"`
}

type Pair added in v0.3.0

type Pair struct {
	Key   string      `yaml:"key"`
	Value interface{} `yaml:"value"`
}

type Proxy added in v0.4.1

type Proxy struct {
	Name     string `yaml:"name" mapstructure:"name"`
	HTTPPort int    `yaml:"http_port" mapstructure:"http_port"`
	GRPCPort int    `yaml:"grpc_port" mapstructure:"grpc_port"`
}

type QueueConfig added in v0.4.1

type QueueConfig struct {
	ID           string   `yaml:"id" mapstructure:"id"`
	Name         string   `yaml:"name" mapstructure:"name"`
	Type         string   `yaml:"type" mapstructure:"type"`
	Version      int64    `yaml:"version" mapstructure:"version"`
	NodeName     int64    `yaml:"node_name" mapstructure:"node_name"`
	Consumers    []string `yaml:"consumers" mapstructure:"consumers"`
	ConsumerType string   `yaml:"consumer_type" mapstructure:"consumer_type"`
	Description  string   `yaml:"description" mapstructure:"description"`
	Metadata     []Pair   `yaml:"metadata" mapstructure:"metadata"`
}

type SearchEngine added in v0.3.1

type SearchEngine struct {
	Use string   `mapstructure:"use" yaml:"use"`
	ES  ESConfig `mapstructure:"elasticsearch" yaml:"elasticsearch"` //nolint
}

type Server

type Server struct {
	Name    string `yaml:"name" mapstructure:"name"`
	AppID   string `yaml:"app_id" mapstructure:"app_id"`
	AppPort int    `yaml:"app_port" mapstructure:"app_port"`
}

type TSeriesServer

type TSeriesServer struct {
	Name       string     `yaml:"name" mapstructure:"name"`
	Enabled    bool       `yaml:"enabled" mapstructure:"enabled"`
	BatchQueue BatchQueue `yaml:"batch_queue" mapstructure:"batch_queue"`
}

Jump to

Keyboard shortcuts

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