config

package
v1.0.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 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,
	},
}

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 {
	Server       ServerConfig `yaml:"server" json:"server"`
	Log          log.LogConfig
	Auth         AuthConfig `yaml:"auth" json:"auth"`
	FoundationDB FoundationDBConfig
	Cdc          CdcConfig
}

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 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