config

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DiscoveryWaySerf uint = iota
	DiscoveryWayMemberlist
)
View Source
const (
	RaftImplHashicorp uint = iota
	RaftImplEtcd
)
View Source
const (
	StorageWayMemory uint = iota
	StorageWayBolt
	StorageWayBadger
	StorageWayRedis
)
View Source
const (
	AuthModeAnonymous uint = iota
	AuthModeUsername
	AuthModeClientid
)
View Source
const (
	AuthDSFree uint = iota
	AuthDSRedis
	AuthDSMysql
	AuthDSPostgresql
	AuthDSHttp
)
View Source
const (
	BridgeWayNone uint = iota
	BridgeWayKafka
)

Variables

View Source
var (
	ErrAuthWay     = errors.New("auth-way is incorrectly configured")
	ErrStorageWay  = errors.New("only redis can be used in cluster mode")
	ErrClusterOpts = errors.New("cluster options must be configured")

	ErrAppendCerts      = errors.New("append ca cert failure")
	ErrMissingCertOrKey = errors.New("missing server certificate or private key files")
)

Functions

func GenTlsConfig

func GenTlsConfig(conf *Config) (*tls2.Config, error)

Types

type Cluster

type Cluster struct {
	DiscoveryWay         uint              `yaml:"discovery-way"  json:"discovery-way"`
	NodeName             string            `yaml:"node-name" json:"node-name"`
	BindAddr             string            `yaml:"bind-addr" json:"bind-addr"`
	BindPort             int               `yaml:"bind-port" json:"bind-port"`
	AdvertiseAddr        string            `yaml:"advertise-addr" json:"advertise-addr"`
	AdvertisePort        int               `yaml:"advertise-port" json:"advertise-port"`
	Members              []string          `yaml:"members" json:"members"`
	QueueDepth           int               `yaml:"queue-depth" json:"queue-depth"`
	Tags                 map[string]string `yaml:"tags" json:"tags"`
	RaftImpl             uint              `yaml:"raft-impl" json:"raft-impl"`
	RaftPort             int               `yaml:"raft-port" json:"raft-port"`
	RaftDir              string            `yaml:"raft-dir" json:"raft-dir"`
	RaftBootstrap        bool              `yaml:"raft-bootstrap" json:"raft-bootstrap"`
	RaftLogLevel         string            `yaml:"raft-log-level" json:"raft-log-level"`
	GrpcEnable           bool              `yaml:"grpc-enable" json:"grpc-enable"`
	GrpcPort             int               `yaml:"grpc-port" json:"grpc-port"`
	InboundPoolSize      int               `yaml:"inbound-pool-size" json:"inbound-pool-size"`
	OutboundPoolSize     int               `yaml:"outbound-pool-size" json:"outbound-pool-size"`
	InoutPoolNonblocking bool              `yaml:"inout-pool-nonblocking" json:"inout-pool-nonblocking"`
	NodesFileDir         string            `yaml:"nodes-file-dir" json:"nodes-file-dir"`
}

type Config

type Config struct {
	StorageWay  uint        `yaml:"storage-way"`
	StoragePath string      `yaml:"storage-path"`
	BridgeWay   uint        `yaml:"bridge-way"`
	BridgePath  string      `yaml:"bridge-path"`
	Auth        auth        `yaml:"auth"`
	Mqtt        mqtt        `yaml:"mqtt"`
	Cluster     Cluster     `yaml:"cluster"`
	Redis       redis       `yaml:"redis"`
	Log         log.Options `yaml:"log"`
	PprofEnable bool        `yaml:"pprof-enable"`
}

func Load

func Load(yamlFile string) (*Config, error)

func New

func New() *Config

Jump to

Keyboard shortcuts

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