Documentation
¶
Overview ¶
Package cache provides caching functionality for kion-cli using a keyring.
Index ¶
- type Cache
- type CacheData
- type NullCache
- func (c *NullCache) FlushCache() error
- func (c *NullCache) GetPassword(host string, idmsID uint, un string) (string, bool, error)
- func (c *NullCache) GetSession() (kion.Session, bool, error)
- func (c *NullCache) GetStak(carName string, accNum string, accAlias string) (kion.STAK, bool, error)
- func (c *NullCache) SetPassword(host string, idmsID uint, un string, pw string) error
- func (c *NullCache) SetSession(session kion.Session) error
- func (c *NullCache) SetStak(carName string, accNum string, accAlias string, value kion.STAK) error
- type RealCache
- func (c *RealCache) FlushCache() error
- func (c *RealCache) GetPassword(host string, idmsID uint, un string) (string, bool, error)
- func (c *RealCache) GetSession() (kion.Session, bool, error)
- func (c *RealCache) GetStak(carName string, accNum string, accAlias string) (kion.STAK, bool, error)
- func (c *RealCache) SetPassword(host string, idmsID uint, un string, pw string) error
- func (c *RealCache) SetSession(session kion.Session) error
- func (c *RealCache) SetStak(carName string, accNum string, accAlias string, value kion.STAK) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
SetStak(carName string, accNum string, accAlias string, value kion.STAK) error
GetStak(carName string, accNum string, accAlias string) (kion.STAK, bool, error)
SetSession(value kion.Session) error
GetSession() (kion.Session, bool, error)
SetPassword(host string, idmsID uint, un string, pw string) error
GetPassword(host string, idmsID uint, un string) (string, bool, error)
FlushCache() error
}
Cache is an interface for storing and receiving data.
type NullCache ¶
type NullCache struct {
}
NullCache implements the Cache interface and does nothing.
func (*NullCache) FlushCache ¶ added in v0.3.0
FLushCache implements the FlushCache interface for NullCache. This is just to satisfy the interface and should never be called.
func (*NullCache) GetPassword ¶ added in v0.7.0
GetPassword returns an empty password, false, and a nil error.
func (*NullCache) GetSession ¶
GetSession implements the Cache interface for NullCache and returns an empty session, false, and a nil error.
func (*NullCache) GetStak ¶
func (c *NullCache) GetStak(carName string, accNum string, accAlias string) (kion.STAK, bool, error)
GetStak returns an empty STAK, false, and a nil error.
func (*NullCache) SetPassword ¶ added in v0.7.0
SetPassword does nothing.
func (*NullCache) SetSession ¶
SetSession implements the Cache interface for NullCache and does nothing.
type RealCache ¶
type RealCache struct {
// contains filtered or unexported fields
}
RealCache is our cache object for passing the keychain to receiver methods.
func (*RealCache) FlushCache ¶ added in v0.3.0
FLushCache implements the FlushCache interface for RealCache.
func (*RealCache) GetPassword ¶ added in v0.7.0
GetPassword retrieves a password from the cache.
func (*RealCache) GetSession ¶
GetSession implements the Cache interface for RealCache and wraps a common function for retrieving session data.
func (*RealCache) GetStak ¶
func (c *RealCache) GetStak(carName string, accNum string, accAlias string) (kion.STAK, bool, error)
GetStak retrieves a STAK from the cache.
func (*RealCache) SetPassword ¶ added in v0.7.0
SetPassword stores a Password in the cache (or removes it if the password is nil).
func (*RealCache) SetSession ¶
SetSession implements the Cache interface for RealCache and wraps a common function for storing session data.