configx

package
v0.0.0-...-df727ae Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

C is a global config instance.

Functions

func LoadWithPathAndName

func LoadWithPathAndName(path, name string) (err error)

LoadWithPathAndName loads config from path and name.

Types

type Config

type Config struct {
	ID   string `json:"id" yaml:"id"`
	Name string `json:"name" yaml:"name"`

	Log  logging.Config `json:"log" yaml:"log"`
	HTTP HTTP           `json:"http" yaml:"http"`

	Storage struct {
		Mongodb struct {
			DSN string `json:"dsn" yaml:"dsn"`
		} `json:"mongodb" yaml:"mongodb"`
	} `json:"storage" yaml:"storage"`

	LineBot struct {
		Secret string `json:"secret" yaml:"secret"`
		Token  string `json:"token" yaml:"token"`
	} `json:"line_bot" yaml:"lineBot"`

	Auth0 struct {
		Domain       string `json:"domain" yaml:"domain"`
		ClientID     string `json:"client_id" yaml:"clientID"`
		ClientSecret string `json:"client_secret" yaml:"clientSecret"`
		CallbackURL  string `json:"callback_url" yaml:"callbackURL"`
	} `json:"auth0" yaml:"auth0"`
}

Config defines the config struct.

func (*Config) String

func (x *Config) String() string

type HTTP

type HTTP struct {
	URL  string `json:"url" yaml:"url"`
	Host string `json:"host" yaml:"host"`
	Port int    `json:"port" yaml:"port"`
	Mode string `json:"mode" yaml:"mode"`
}

HTTP defines the http struct.

func (*HTTP) GetAddr

func (http *HTTP) GetAddr() string

GetAddr is used to get the http address.

Jump to

Keyboard shortcuts

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