state

package
v0.0.0-...-68889fd Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookedTokenManager

type HookedTokenManager struct {
	Setter func(subject, token string) error
	Getter func(subject string) (string, error)
}

HookedTokenManager is just a dummy wrapper around a TokenManager where a user can provide functions without having to wrap everything in a full struct

func (*HookedTokenManager) Get

func (m *HookedTokenManager) Get(subject string) (string, error)

Get invokes the user-defined Getter

func (*HookedTokenManager) Set

func (m *HookedTokenManager) Set(subject, token string) error

Set invokes the user-defined Setter

type MemoryTokenManager

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

MemoryTokenManager just shoves the token some place in an in memory cache

func NewMemoryTokenManager

func NewMemoryTokenManager() *MemoryTokenManager

NewMemoryTokenManager initializes a MemoryTokenManager

func (*MemoryTokenManager) Get

func (m *MemoryTokenManager) Get(subject string) (string, error)

Get returns a token from the cache

func (*MemoryTokenManager) Set

func (m *MemoryTokenManager) Set(subject, token string) error

Set stores the token in the cache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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