cliutil

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cliutil contains functionality related to CLI apps.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpired  = errors.New("expired")
	ErrInvalid  = errors.New("invalid")
	ErrNotFound = errors.New("not found")
)

predefined cache errors

Functions

This section is empty.

Types

type JWTCache

type JWTCache interface {
	DeleteJWT(key string) error
	LoadJWT(key string) (rawJWT string, err error)
	StoreJWT(key string, rawJWT string) error
}

A JWTCache loads and stores JWTs.

type LocalJWTCache

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

A LocalJWTCache stores files in the user's cache directory.

func NewLocalJWTCache

func NewLocalJWTCache() (*LocalJWTCache, error)

NewLocalJWTCache creates a new LocalJWTCache.

func (*LocalJWTCache) DeleteJWT

func (cache *LocalJWTCache) DeleteJWT(key string) error

DeleteJWT deletes a raw JWT from the local cache.

func (*LocalJWTCache) LoadJWT

func (cache *LocalJWTCache) LoadJWT(key string) (rawJWT string, err error)

LoadJWT loads a raw JWT from the local cache.

func (*LocalJWTCache) StoreJWT

func (cache *LocalJWTCache) StoreJWT(key string, rawJWT string) error

StoreJWT stores a raw JWT in the local cache.

type MemoryJWTCache

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

A MemoryJWTCache stores JWTs in an in-memory map.

func NewMemoryJWTCache

func NewMemoryJWTCache() *MemoryJWTCache

NewMemoryJWTCache creates a new in-memory JWT cache.

func (*MemoryJWTCache) DeleteJWT

func (cache *MemoryJWTCache) DeleteJWT(key string) error

DeleteJWT deletes a JWT from the in-memory map.

func (*MemoryJWTCache) LoadJWT

func (cache *MemoryJWTCache) LoadJWT(key string) (rawJWT string, err error)

LoadJWT loads a JWT from the in-memory map.

func (*MemoryJWTCache) StoreJWT

func (cache *MemoryJWTCache) StoreJWT(key string, rawJWT string) error

StoreJWT stores a JWT in the in-memory map.

Jump to

Keyboard shortcuts

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