config

package
v0.0.0-...-b87af0c Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPrefix = "DRIFTBASE_WEBHOOK"

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Redis RedisConfig `mapstructure:"redis"`
}

type Config

type Config struct {
	Server    ServerConfig    `mapstructure:"server"`
	Database  DatabaseConfig  `mapstructure:"database"`
	Cache     CacheConfig     `mapstructure:"cache"`
	TaskQueue TaskQueueConfig `mapstructure:"task_queue"`
	Storage   StorageConfig   `mapstructure:"storage"`
}

func NewConfig

func NewConfig(path string, name string) *Config

type DatabaseConfig

type DatabaseConfig struct {
	Provider string         `mapstructure:"provider"`
	Postgres PostgresConfig `mapstructure:"postgres"`
	Yugabyte YugabyteConfig `mapstructure:"yugabyte"`
}

type NATSConfig

type NATSConfig struct {
	Urls     []string `mapstructure:"urls"`
	Username string   `mapstructure:"username"`
	Password string   `mapstructure:"password"`
}

type PostgresConfig

type PostgresConfig struct {
	Host               string     `mapstructure:"host"`
	Port               uint       `mapstructure:"port"`
	User               UserConfig `mapstructure:"user"`
	Database           string     `mapstructure:"database"`
	Options            string     `mapstructure:"options"`
	MaxOpenConnections uint       `mapstructure:"max_open_connections"`
	MaxIdleConnections uint       `mapstructure:"max_idle_connections"`
}

type RedisConfig

type RedisConfig struct {
	Url      string `mapstructure:"url"`
	Database string `mapstructure:"database"`
	Password string `mapstructure:"password"`
}

type S3Config

type S3Config struct {
	Endpoint       string `mapstructure:"endpoint"`
	AccessKey      string `mapstructure:"access_key"`
	SecretKey      string `mapstructure:"secret_key"`
	Bucket         string `mapstructure:"bucket"`
	PathPrefix     string `mapstructure:"path_prefix"`
	Region         string `mapstructure:"region"`
	ForcePathStyle bool   `mapstructure:"force_path_style"`
	DisableSSL     bool   `mapstructure:"disable_ssl"`
}

type ServerConfig

type ServerConfig struct {
	Host string `mapstructure:"host"`
	Port uint   `mapstructure:"port"`
	SSL  bool   `mapstructure:"ssl"`
	Env  string `mapstructure:"env"`
}

type StorageConfig

type StorageConfig struct {
	S3 S3Config `mapstructure:"s3"`
}

type TaskQueueConfig

type TaskQueueConfig struct {
	NATS NATSConfig `mapstructure:"nats"`
}

type UserConfig

type UserConfig struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

type YugabyteConfig

type YugabyteConfig struct {
	Host               string     `mapstructure:"host"`
	Port               uint       `mapstructure:"port"`
	User               UserConfig `mapstructure:"user"`
	Database           string     `mapstructure:"database"`
	Options            string     `mapstructure:"options"`
	MaxOpenConnections uint       `mapstructure:"max_open_connections"`
	MaxIdleConnections uint       `mapstructure:"max_idle_connections"`
}

Jump to

Keyboard shortcuts

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