token

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package token is for api token management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(email, pass string) (string, error)

Generate generates the token

func Revoke

func Revoke(tk string) error

Revoke revokes a token

func SendPass

func SendPass(email string) error

SendPass sends a one time pass

func SetToken

func SetToken(tk string)

SetToken sets the api token

func Verify

func Verify(tk string) error

Verify a token is valid

Types

type Token

type Token struct {
	*p.Token
}

func List

func List() ([]*Token, error)

List lists the tokens

func New

func New() *Token

New returns a new token

func (*Token) Decode

func (t *Token) Decode(key string, b []byte) error

func (*Token) Encode

func (t *Token) Encode(key string) (string, error)

func (*Token) Valid

func (t *Token) Valid() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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