option

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminOption

type AdminOption struct {
	ID       uint   `default:"1"`
	Nickname string `default:"管理员"`
	Username string `default:"admin"`
	Password string `required:"true"`
}

type DatabaseOption

type DatabaseOption struct {
	Driver string `default:"mysql"`

	// mysql
	Port     int    `default:"0"`
	Host     string `default:""`
	Name     string `default:""`
	Username string `default:""`
	Password string `default:""`

	// sqlite
	DSN string `default:""`
}

type JwtOption

type JwtOption struct {
	Secret string `default:"jwt_secret"`
	Expire int    `default:"7200"`
}

type LoggerOption

type LoggerOption struct {
	Level string `default:"debug"`
}

type Option

type Option struct {
	Logger    LoggerOption
	Server    ServerOption
	DB        DatabaseOption
	Admin     AdminOption
	Jwt       JwtOption
	Router    RouterOption
	Signature SignatureOption
	Redis     RedisOption
}

type RedisOption added in v1.2.4

type RedisOption struct {
	Enable   bool   `default:"false"`
	Host     string `default:"localhost"`
	Password string `default:""`
	DB       int    `default:"0"`
	Port     int    `default:"6379"`
}

func (RedisOption) Addr added in v1.2.4

func (r RedisOption) Addr() string

type RouterOption

type RouterOption struct {
	Prefix string `default:""`
}

type ServerOption

type ServerOption struct {
	Port int `default:"3080"`
	Host string
}

type SignatureOption

type SignatureOption struct {
	Enable bool   `default:"false"`
	Pri    string `default:""`
	Pub    string `default:""`
}

Jump to

Keyboard shortcuts

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