oauth2

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package oauth2 provides OAuth 2.0 verification.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
)

Functions

This section is empty.

Types

type Token

type Token string

Token represents an access token.

func NewToken

func NewToken(id string) (Token, int64, error)

NewToken generates an access token.

func (Token) ID

func (t Token) ID() string

ID returns the id of t.

func (Token) Role

func (t Token) Role() (member.Role, error)

Role returns the role corresponding to t.

func (Token) Valid

func (t Token) Valid() error

Valid reports whether t is valid or not.

Jump to

Keyboard shortcuts

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