config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Configuration = Config{}

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Host      string `mapstructure:"host" default:"0.0.0.0"`
	Port      string `mapstructure:"port" default:"8080"`
	DebugMode bool   `mapstructure:"debug_mode" default:"false"`
}

type AuthConfig

type AuthConfig struct {
	Secret string `mapstructure:"secret"`
}

type AuthenticityConfig

type AuthenticityConfig struct {
	KeyConfig         KeyConfig         `mapstructure:"key"`
	CertificateConfig CertificateConfig `mapstructure:"certificate"`
}

type BloockConfig

type BloockConfig struct {
	ApiHost          string `mapstructure:"api_host" default:"https://api.bloock.com"`
	ApiKey           string `mapstructure:"api_key"`
	CdnHost          string `mapstructure:"cdn_host" default:"https://cdn.bloock.com"`
	WebhookSecretKey string `mapstructure:"webhook_secret_key"`
}

type CertificateConfig

type CertificateConfig struct {
	Pkcs12Path     string `mapstructure:"pkcs12_path"`
	Pkcs12Password string `mapstructure:"pkcs12_password"`
}

type Config

type Config struct {
	Api          APIConfig
	Auth         AuthConfig
	Db           DBConfig
	Bloock       BloockConfig
	Webhook      WebhookConfig
	Authenticity AuthenticityConfig
	Encryption   EncryptionConfig
	Storage      StorageConfig
	Integrity    IntegrityConfig
}

func InitConfig

func InitConfig(logger zerolog.Logger) (*Config, error)

type DBConfig

type DBConfig struct {
	ConnectionString string `mapstructure:"connection_string" default:"file:managed?mode=memory&cache=shared&_fk=1"`
}

type EncryptionConfig

type EncryptionConfig struct {
	KeyConfig         KeyConfig         `mapstructure:"key"`
	CertificateConfig CertificateConfig `mapstructure:"certificate"`
}

type IntegrityConfig added in v1.3.0

type IntegrityConfig struct {
	AggregateMode     bool `mapstructure:"aggregate_mode" default:"false"`
	AggregateWorker   bool `mapstructure:"aggregate_worker" default:"false"`
	AggregateInterval int  `mapstructure:"aggregate_interval" default:"3600"`
}

type KeyConfig

type KeyConfig struct {
	KeyType string `mapstructure:"key_type"`
	Key     string `mapstructure:"key"`
}

type StorageConfig

type StorageConfig struct {
	TmpDir        string `mapstructure:"tmp_dir" default:"./tmp"`
	LocalPath     string `mapstructure:"local_path" default:"./data"`
	LocalStrategy string `mapstructure:"local_strategy" default:"HASH"`
}

type WebhookConfig

type WebhookConfig struct {
	ClientEndpointUrl string `mapstructure:"client_endpoint_url"`
	MaxRetries        uint64 `mapstructure:"max_retries"`
}

Jump to

Keyboard shortcuts

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