config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigDirectory

func DefaultConfigDirectory() string

func DefaultConfigFile

func DefaultConfigFile() string

Types

type ClientConfig

type ClientConfig struct {
	Host string `mapstructureL:"host"`
}

type Config

type Config struct {
	Http    *Http           `mapstructure:"http"`
	Storage *StorageConfig  `mapstructure:"storage"`
	Db      *DatabaseConfig `mapstructure:"db"`
	Client  *ClientConfig   `mapstructure:"client"`
}

func LoadConfigFromViper

func LoadConfigFromViper() (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

type DatabaseConfig

type DatabaseConfig struct {
	Type     string                  `mapstructure:"type" default:"postgres"`
	Postgres *PostgresDatabaseConfig `mapstructure:"postgres"`
}

type Http

type Http struct {
	Host     string `mapstructure:"host" default:""`
	Port     int    `mapstructure:"port" default:"9002"`
	SiteData string `mapstructure:"sitedata"`
}

type PostgresDatabaseConfig

type PostgresDatabaseConfig struct {
	Host     string `mapstructure:"host"`
	Port     uint16 `mapstructure:"port" default:"5432"`
	Username string `mapstructure:"username" default:"postgres"`
	Password string `mapstructure:"password" default:"postgres"`
	Database string `mapstructure:"database" default:"default"`
	SslMode  string `mapstructure:"sslmode" default:"disable"`
}

type S3StorageConfig

type S3StorageConfig struct {
	Endpoint       *string `mapstructure:"endpoint"`
	Region         *string `mapstructure:"region"`
	BucketName     string  `mapstructure:"bucketName"`
	DisableSSL     *bool   `mapstructure:"disablessl"`
	ForcePathStyle *bool   `mapstructure:"forcepathstyle"`
}

type StorageConfig

type StorageConfig struct {
	Type string           `mapstructure:"type" default:"s3"`
	S3   *S3StorageConfig `mapstructure:"s3"`
}

Jump to

Keyboard shortcuts

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