token

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register() common.Caller

Types

type CallerCfg

type CallerCfg struct {
	Mode string

	LoggerRef string
	Logger    LoggerCallerCfg `toml:"logger"`

	MysqlRef string
	Mysql    MysqlCallerCfg `toml:"mysql"`

	RedisRef string
	Redis    RedisCallerCfg `toml:"redis"`
}

CallerCfg是token的配置。 需要注意的是,XXXRef是指指定了一个已经在配置文件里面的Caller。 比如说,你已经设置了一个mysql数据库myDB用于存储数据,而你又希望同时使用该数据库来存放token的数据, 那么你只需将MysqlRef设置为myDB。 如果你没有指定Ref,那么token会在初始化的时候依据配置来重新创建一个

type Cfg

type Cfg struct {
	Muses struct {
		Token map[string]CallerCfg `toml:"token"`
	} `toml:"muses"`
}

type Client

type Client struct {
	standard.TokenAccessor
	// contains filtered or unexported fields
}

func Caller

func Caller(name string) *Client

type LoggerCallerCfg

type LoggerCallerCfg logger.CallerCfg

type MysqlCallerCfg

type MysqlCallerCfg mysql.CallerCfg

type RedisCallerCfg

type RedisCallerCfg redis.CallerCfg

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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