config

package
v1.0.0-alpha.20 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvTest        = "test"
	EnvDevelopment = "development"
	EnvProduction  = "production"
)

Variables

View Source
var DefaultConfig = Config{
	Log: log.LogConfig{
		Level: "trace",
	},
	Server: ServerConfig{
		Host: "0.0.0.0",
		Port: 8081,
	},
	Auth: AuthConfig{
		IssuerURL:        "https://tigrisdata-dev.us.auth0.com/",
		Audience:         "https://tigris-db-api",
		JWKSCacheTimeout: 5 * time.Minute,
		LogOnly:          true,
	},
	Cdc: CdcConfig{
		Enabled:        true,
		StreamInterval: 500 * time.Millisecond,
		StreamBatch:    100,
		StreamBuffer:   200,
	},
	Search: SearchConfig{
		Host:         "localhost",
		Port:         8108,
		ReadEnabled:  true,
		WriteEnabled: true,
	},
}

Functions

func GetEnvironment

func GetEnvironment() string

func LoadConfig

func LoadConfig(name string, config interface{})

func LoadEnvironment

func LoadEnvironment()

Types

type AuthConfig

type AuthConfig struct {
	IssuerURL        string
	Audience         string
	JWKSCacheTimeout time.Duration
	LogOnly          bool
}

type CdcConfig

type CdcConfig struct {
	Enabled        bool
	StreamInterval time.Duration
	StreamBatch    int
	StreamBuffer   int
}

type Config

type Config struct {
	Log          log.LogConfig
	Server       ServerConfig `yaml:"server" json:"server"`
	Auth         AuthConfig   `yaml:"auth" json:"auth"`
	Cdc          CdcConfig    `yaml:"cdc" json:"cdc"`
	Search       SearchConfig `yaml:"search" json:"search"`
	FoundationDB FoundationDBConfig
}

type FoundationDBConfig

type FoundationDBConfig struct {
	ClusterFile string `mapstructure:"cluster_file" json:"cluster_file" yaml:"cluster_file"`
}

FoundationDBConfig keeps FoundationDB configuration parameters

func GetTestFDBConfig

func GetTestFDBConfig(path string) (*FoundationDBConfig, error)

type SearchConfig

type SearchConfig struct {
	Host         string
	Port         int16
	AuthKey      string `mapstructure:"auth_key" json:"auth_key" yaml:"auth_key"`
	ReadEnabled  bool
	WriteEnabled bool
}

type ServerConfig

type ServerConfig struct {
	Host string
	Port int16
}

Jump to

Keyboard shortcuts

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