config

package module
v0.0.0-...-d01c34b Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Environment string `yaml:"environment"`

	SqlDriver string `yaml:"sqldriver"`
	User      string `yaml:"user"`     // 環境変数から取得
	Password  string `yaml:"password"` // 環境変数から取得
	Protocol  string `yaml:"protocol"`
	Address   string `yaml:"address"`
	DataBase  string `yaml:"database"`

	Auth ConfigAuth `yaml:"auth"` // 環境変数から取得
}
var Cfg *Config

func LoadConfig

func LoadConfig(filePath string) (config *Config, err error)

設定ファイルを読み込む 秘匿情報は環境変数から読み込みます https://mtyurt.net/post/go-using-environment-variables-in-configuration-files.html

type ConfigAuth

type ConfigAuth struct {
	SignKey         string `yaml:"signkey"`          // 環境変数から取得
	TokenExpiration int    `yaml:"token_expiration"` // トークン有効期限(秒)
}

Jump to

Keyboard shortcuts

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