token

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package token provides a simple token middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager represents a token manager.

func New

func New(name string, path string, secure bool, key []byte) *Manager

New creates a new token manager.

func (*Manager) Check

func (a *Manager) Check(ctx *ws.Context, refresh bool) ([]byte, error)

Check checks the token.

func (*Manager) Create

func (a *Manager) Create(ctx *ws.Context, age time.Duration, data []byte)

Create creates a new token.

func (*Manager) Delete

func (a *Manager) Delete(ctx *ws.Context) error

Delete deletes the token.

Jump to

Keyboard shortcuts

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