config

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChromaStyles

func GetChromaStyles() []string

GetChromaStyles returns the list of available syntax highlighting themes

func GetTimezones

func GetTimezones() []string

GetTimezones returns the list of available timezones

Types

type Config

type Config struct {
	Server struct {
		Host string `mapstructure:"host"`
		Port int    `mapstructure:"port"`
	}
	Site struct {
		SecureCookie bool   `mapstructure:"secure_cookie"`
		Domain       string `mapstructure:"domain"`
		Theme        string `mapstructure:"theme"`
	} `mapstructure:"site"`
	DB struct {
		Path     string `mapstructure:"path"`
		LogLevel string `mapstructure:"log_level"`
	}
	Storage struct {
		Provider string `mapstructure:"provider"` // "local" or "s3"
		S3       struct {
			Bucket    string `mapstructure:"bucket"`
			Region    string `mapstructure:"region"`
			Endpoint  string `mapstructure:"endpoint"`
			AccessKey string `mapstructure:"access_key"`
			SecretKey string `mapstructure:"secret_key"`
		}
		LocalPath string `mapstructure:"local_path"` // Path for local storage
	}
	Debug bool `mapstructure:"debug"`
}

func InitConfig

func InitConfig() (*Config, error)

func (*Config) GetGormLogLevel

func (c *Config) GetGormLogLevel() logger.LogLevel

GetGormLogLevel returns the gorm logger level based on the config

func (*Config) ValidateS3Config

func (c *Config) ValidateS3Config() error

ValidateS3Config validates S3 configuration if S3 provider is selected

Jump to

Keyboard shortcuts

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