token

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package token is for api token management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commands

func Commands() []cli.Command

Commands returns token commands

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

Jump to

Keyboard shortcuts

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