options

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppOptions

type AppOptions struct {
	DefaultPageSize       int
	MaxPageSize           int
	DefaultContextTimeout time.Duration
	LogSavePath           string
	LogFileName           string
	LogFileExt            string
	UploadSavePath        string
	UploadServerUrl       string
	UploadImageMaxSize    int
	UploadImageAllowExts  []string
}

type DBOptions

type DBOptions struct {
	DBType                string `json:"dbtype,omitempty"                   mapstructure:"db-type"`
	Host                  string `json:"host,omitempty"                     mapstructure:"host"`
	Port                  string `json:"port,omitempty"                     mapstructure:"port"`
	Username              string `json:"username,omitempty"                 mapstructure:"username"`
	Password              string `json:"password"                           mapstructure:"password"`
	Database              string `json:"database"                           mapstructure:"database"`
	Config                string `json:"config" 							mapstructure:"config"`
	MaxIdleConnections    int    `json:"max-idle-connections,omitempty"     mapstructure:"max-idle-connections"`
	MaxOpenConnections    int    `json:"max-open-connections,omitempty"     mapstructure:"max-open-connections"`
	MaxConnectionIdleTime int    `json:"max-connection-idle-time"   		mapstructure:"max-connection-idle-time"` //秒
	MaxConnectionLifeTime int    `json:"max-connection-life-time" 			mapstructure:"max-connection-life-time"`  //秒
	LogLevel              int    `json:"log-level"                          mapstructure:"log-level"`
	IsDebug               bool   `json:"isdebug"                            mapstructure:"is-debug"`
	TablePrefix           string `json:"tableprefix"                        mapstructure:"table-prefix"`
}

DBOptions defines options for database.

func (*DBOptions) NewClient

func (o *DBOptions) NewClient() (*gorm.DB, error)

NewClient create mysql store with the given config.

type JWTSettingS

type JWTSettingS struct {
	Secret string
	Issuer string
	Expire time.Duration
}

type ServerOptions

type ServerOptions struct {
	RunMode      string
	HttpPort     string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

Jump to

Keyboard shortcuts

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