config

package
v0.0.0-...-7c54f9f Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLogLevel = "info"
	DefaultPort     = 8080
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LogLevel          string `long:"log_level" description:"Logging level {debug, info, warn, error}"`
	Port              int    `long:"port" description:"Port to listen on"`
	GinMode           string `long:"gin_mode" description:"Gin mode {debug, release}"`
	GoogleAnalyticsID string `long:"google_analytics_id" description:"Google Analytics ID"`

	Auth       auth.Config       `group:"auth" namespace:"auth"`
	Email      email.Config      `group:"email" namespace:"email"`
	Cloudflare cloudflare.Config `group:"cloudflare" namespace:"cloudflare"`
	Store      store.Config      `group:"store" namespace:"store"`
	Lightning  lightning.Config  `group:"lightning" namespace:"lightning"`
	L402       l402.Config       `group:"l402" namespace:"l402"`
	Video      video.Config      `group:"video" namespace:"video"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(logger *slog.Logger) (*Config, error)

func (*Config) SetGinMode

func (c *Config) SetGinMode()

func (*Config) SetLoggerLevel

func (c *Config) SetLoggerLevel() error

func (*Config) Validate

func (c *Config) Validate() error

type EmailConfig

type EmailConfig struct {
	Provider string `long:"provider" description:"Email provider"`
	APIKey   string `long:"api_key" description:"Email provider API key"`
}

type StorageConfig

type StorageConfig struct {
	Provider string `long:"provider" description:"Storage provider"`
	Local    struct {
		Path string `long:"path" description:"Local storage path"`
	} `group:"local" namespace:"local"`
}

Jump to

Keyboard shortcuts

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