config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global = new(Config)

Functions

func Init

func Init(path string) error

Init init the config.

Types

type Auth added in v0.1.0

type Auth struct {
	Enabled  bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
	Username string `mapstructure:"username" json:"username" yaml:"username"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
}

type Config

type Config struct {
	Env     string  `mapstructure:"env" json:"env" yaml:"env"`
	Engine  Engine  `mapstructure:"engine" json:"engine" yaml:"engine"`
	Storage Storage `mapstructure:"storage" json:"storage" yaml:"storage"`
	Http    Http    `mapstructure:"http" json:"http" yaml:"http"`
}

type Engine

type Engine struct {
	DefaultNumberOfShards   int `mapstructure:"default-number-of-shards" json:"default_number_of_shards" yaml:"default-number-of-shards"`
	DefaultBatchSize        int `mapstructure:"default-batch-size" json:"default_batch_size" yaml:"default-batch-size"`
	DefaultSearchResultSize int `mapstructure:"default-search-result-size" json:"default_search_result_size" yaml:"default-search-result-size"`
}

type Http

type Http struct {
	ServerAddr string `mapstructure:"server-addr" json:"server_addr" yaml:"server-addr"`
	Auth       Auth   `mapstructure:"auth" json:"auth" yaml:"auth"`
}

type Storage

type Storage struct {
	MetaType string `mapstructure:"meta-type" json:"meta_type" yaml:"meta-type"`
	DataDir  string `mapstructure:"data-dir" json:"data_dir" yaml:"data-dir"`
}

Jump to

Keyboard shortcuts

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