config

package
v0.4.29 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigMap = map[string]any{}

Functions

This section is empty.

Types

type Config added in v0.4.22

type Config struct {
	Key      string          `json:"key,omitempty"`
	Net      Net             `json:"net"`
	Web      Web             `json:"web"`
	Grpc     Grpc            `json:"grpc"`
	Security Security        `json:"security"`
	SQLs     map[string]SQL  `json:"sql,omitempty"`
	Smtp     map[string]Smtp `json:"smtp,omitempty"`
	Others   map[string]any  `json:"others,omitempty"`

	EnvFile   string `json:"env_file,omitempty"`
	IsTesting bool   `json:"is_testing,omitempty"`
	Forever   bool   `json:"-"`
}

func (*Config) Map added in v0.4.22

func (c *Config) Map() map[string]any

type Grpc

type Grpc struct {
	Enabled bool
	Host    string
}

type Http

type Http struct {
	URL  string            `json:"url"`
	With map[string]string `json:"with"`
}

type Net added in v0.4.23

type Net struct {
	Enabled bool
	Type    string
	Address string
}

type SQL

type SQL struct {
	Driver  string
	DSN     string
	Enabled bool
	With    map[string]string
}

type Security

type Security struct {
	Secret string `json:"secret,omitempty"`
}

type Smtp

type Smtp struct {
	From string
	User string
	Pass string
	Host string
	Port string
}

type Web

type Web struct {
	Enabled bool                `json:"enabled,omitempty"`
	Host    string              `json:"host,omitempty"`
	Log     some.Some[WebLog]   `json:"log"`
	Cors    some.Some[WebCors]  `json:"cors"`
	Pprof   some.Some[WebPprof] `json:"pprof"`
	Views   WebViews            `json:"views"`
	Static  WebStatic           `json:"static"`
}

func (Web) GetCors

func (r Web) GetCors() cors.Config

func (Web) GetLog

func (r Web) GetLog() log.Config

func (Web) GetPprof

func (r Web) GetPprof() pprof.Config

func (Web) GetStatic

func (r Web) GetStatic() WebStatic

func (Web) GetViews

func (r Web) GetViews() WebViews

type WebCors

type WebCors struct {
	Enabled          bool   `json:"enabled,omitempty"`
	AllowOrigins     string `json:"allow_origins,omitempty"`
	AllowCredentials bool   `json:"allow_credentials,omitempty"`
	AllowMethods     string `json:"allow_methods,omitempty"`
	AllowHeaders     string `json:"allow_headers,omitempty"`
	MaxAge           int    `json:"max_age,omitempty"`
	ExposeHeaders    string `json:"expose_headers,omitempty"`
}

type WebLog

type WebLog struct {
	Enabled bool `json:"enabled,omitempty"`
}

type WebPprof

type WebPprof struct {
	Enabled bool   `json:"enabled,omitempty"`
	Prefix  string `json:"prefix,omitempty"`
}

type WebStatic

type WebStatic struct {
	Enabled bool   `json:"enabled,omitempty"`
	Prefix  string `json:"prefix,omitempty"`
	Dir     string `json:"dir,omitempty"`
}

type WebViews

type WebViews struct {
	Enabled bool   `json:"enabled,omitempty"`
	Dir     string `json:"dir,omitempty"`
	Layout  string `json:"layout,omitempty"`
}

Jump to

Keyboard shortcuts

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