service

package
v0.0.0-...-41229de Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContainer

func BuildContainer()

BuildContainer 容器创建&注入

Types

type Config

type Config struct {
	App struct {
		Name     string
		URL      string
		Port     string
		Debug    bool
		AppOwner string
	}

	Database struct {
		Dirver string
	} `toml:"database"`

	Mysql struct {
		Dbname   string
		Username string
		Password string
	} `toml:"mysql"`

	Website struct {
		// contains filtered or unexported fields
	}

	Redis struct {
		// Network "tcp"
		Network string
		// Addr "127.0.0.1:6379"
		Addr string
		// Password string .If no password then no 'AUTH'. Default ""
		Password string
		// If Database is empty "" then no 'SELECT'. Default ""
		Database string
		// MaxIdle 0 no limit
		MaxIdle int
		// MaxActive 0 no limit
		MaxActive int
		// IdleTimeout  time.Duration(5) * time.Minute
		IdleTimeout time.Duration
		// Prefix "myprefix-for-this-website". Default ""
		Prefix string
	}

	Session struct {
		Cookie  string
		Expires time.Duration
		Dirver  string
	}
}

func AppConfig

func AppConfig() *Config

type Di

type Di struct {
	Container *dig.Container
}

func GetDi

func GetDi() *Di

GetDi get

Jump to

Keyboard shortcuts

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