keyman

package module
v0.0.0-...-615a2ef Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: GPL-3.0 Imports: 16 Imported by: 1

README

keyman

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrToStr

func AddrToStr(addr *common.Address) string

func KeyToAddr

func KeyToAddr(key string) *common.Address

func KeyToAddrStr

func KeyToAddrStr(key string) string

func MakeToken

func MakeToken(priv *ecdsa.PrivateKey) string

func StrToPriv

func StrToPriv(key string) *ecdsa.PrivateKey

func TokenToAddr

func TokenToAddr(token string) (*common.Address, error)

func TokenToAddrStr

func TokenToAddrStr(token string) (string, error)

func TokenToPub

func TokenToPub(token string) (*ecdsa.PublicKey, error)

func TokenToPubStr

func TokenToPubStr(token string) (string, error)

Types

type HKey

type HKey struct {
	Key  string `form:"key" json:"key" xml:"key"`
	Name string `form:"name" json:"name" xml:"name"`
}

type Key

type Key struct {
	Key    string `form:"key" json:"key" xml:"key" binding:"required"`
	Expday int    `form:"expday" json:"expday" xml:"expday"`
	Number int64  `form:"number" json:"number" xml:"number"`
}

type Keyman

type Keyman struct {
	Keypre     string
	RedisPool  *redis.Pool
	TokenCache gcache.Cache
	TokenTime  time.Duration
}

func (*Keyman) AddCount

func (keyman *Keyman) AddCount(c *gin.Context)

func (*Keyman) AddTotalCount

func (keyman *Keyman) AddTotalCount(c *gin.Context)

func (*Keyman) Addkey

func (keyman *Keyman) Addkey(c *gin.Context)

func (*Keyman) CheckGetToken

func (keyman *Keyman) CheckGetToken(c *gin.Context) *TokenInfo

func (*Keyman) CheckKey

func (keyman *Keyman) CheckKey(key string) error

func (*Keyman) CheckKeyOnlytime

func (keyman *Keyman) CheckKeyOnlytime(key string) error

func (*Keyman) CheckPathKeyCount

func (keyman *Keyman) CheckPathKeyCount(reqpath, key string) error

func (*Keyman) CheckToken

func (keyman *Keyman) CheckToken(c *gin.Context) *TokenInfo

func (*Keyman) DecKeyNum

func (keyman *Keyman) DecKeyNum(key string) error

func (*Keyman) DecPathKeyCount

func (keyman *Keyman) DecPathKeyCount(reqpath, key string) error

func (*Keyman) DecPathKeyCountHandle

func (keyman *Keyman) DecPathKeyCountHandle(c *gin.Context) bool

func (*Keyman) Delkey

func (keyman *Keyman) Delkey(c *gin.Context)

func (*Keyman) Diskey

func (keyman *Keyman) Diskey(c *gin.Context)

func (*Keyman) Enable

func (keyman *Keyman) Enable(c *gin.Context)

func (*Keyman) GetCount

func (keyman *Keyman) GetCount(c *gin.Context)

func (*Keyman) GetKeyAddr

func (keyman *Keyman) GetKeyAddr(c *gin.Context)

func (*Keyman) GetKeyExpdate

func (keyman *Keyman) GetKeyExpdate(c *gin.Context)

func (*Keyman) GetManPriv

func (keyman *Keyman) GetManPriv(c *gin.Context) (*ecdsa.PrivateKey, error)

func (*Keyman) GetPriv

func (keyman *Keyman) GetPriv(c *gin.Context) (*ecdsa.PrivateKey, error)

func (*Keyman) GetToken

func (keyman *Keyman) GetToken(c *gin.Context)

token route access

func (*Keyman) Getkey

func (keyman *Keyman) Getkey(c *gin.Context)

func (*Keyman) Getownkey

func (keyman *Keyman) Getownkey(c *gin.Context)

func (*Keyman) InitHandle

func (keyman *Keyman) InitHandle(router *gin.Engine)

func (*Keyman) IsKeyValid

func (keyman *Keyman) IsKeyValid(c *gin.Context) bool

func (*Keyman) IsKeyValidOnlytime

func (keyman *Keyman) IsKeyValidOnlytime(c *gin.Context) bool

func (*Keyman) IsKeyValidRet

func (keyman *Keyman) IsKeyValidRet(c *gin.Context) (*ecdsa.PrivateKey, bool)

func (*Keyman) IsPathKeyValid

func (keyman *Keyman) IsPathKeyValid(c *gin.Context) bool

func (*Keyman) IsPathKeyValidRet

func (keyman *Keyman) IsPathKeyValidRet(c *gin.Context) (*ecdsa.PrivateKey, bool)

func (*Keyman) Listkey

func (keyman *Keyman) Listkey(c *gin.Context)

func (*Keyman) StrToPriv

func (keyman *Keyman) StrToPriv(key string) *ecdsa.PrivateKey

type TokenInfo

type TokenInfo struct {
	Key   string `form:"key" json:"key" xml:"key" binding:"required"`
	Route string `form:"Route" json:"Route" xml:"Route"`
}

func (*TokenInfo) Marshal

func (tokenInfo *TokenInfo) Marshal() ([]byte, error)

func (*TokenInfo) Unmarshal

func (tokenInfo *TokenInfo) Unmarshal(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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