token

package
v0.0.0-...-c9dffe9 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package token provides cache for token.

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidToken    = errors.New("ERROR:Invalid Token")
	NoTokenProvided = errors.New("ERROR:No Token Provided")
)

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(token string) *TtyParameter
	Delete(token string) error
	Add(token string, param *TtyParameter, d time.Duration) error
}

Cache interface that defines token cache behavior

type MemCache

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

MemCache use memory to store token and TtyParameter

func NewMemCache

func NewMemCache() *MemCache

NewMemCache new MemCache

func (*MemCache) Add

func (r *MemCache) Add(token string, param *TtyParameter, d time.Duration) error

Add token to memory

func (*MemCache) Delete

func (r *MemCache) Delete(token string) error

Delete token from memory

func (*MemCache) Get

func (r *MemCache) Get(token string) *TtyParameter

Get token param from memory

type TtyParameter

type TtyParameter struct {
	Title string
	Arg   []string
}

TtyParameter kubectl tty param

Jump to

Keyboard shortcuts

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