auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Definition error

Functions

This section is empty.

Types

type Auther

type Auther interface {
	// Generate token
	GenerateToken(ctx context.Context, userUUID string) (TokenInfo, error)

	// Destroy token
	DestroyToken(ctx context.Context, accessToken string) error

	// Resolve user ID
	ParseUserUUID(ctx context.Context, accessToken string) (string, error)

	// Release resources
	Release() error
}

Auther - Authentication interface

type TokenInfo

type TokenInfo interface {
	// Get access token
	GetAccessToken() string
	// Get token type
	GetTokenType() string
	// Get token expiration timestamp
	GetExpiresAt() int64
	// JSON encoding
	EncodeToJSON() ([]byte, error)
}

TokenInfo - Token information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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