cache

package
v0.0.0-...-fc64511 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT, MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.Mutex
	Cache map[string]connection.Connection // maps host to Connection struct
	// contains filtered or unexported fields
}

func NewCache

func NewCache(logger hclog.Logger) *Cache

func (*Cache) Close

func (c *Cache) Close(host string) error

func (*Cache) Command

func (c *Cache) Command(ctx context.Context, cmd, host string, cfg *connection.Config) (string, error)

func (*Cache) Create

func (c *Cache) Create(host string, cfg *connection.Config) (connection.Connection, error)

Create a new item, protected by mutex

func (*Cache) Get

func (c *Cache) Get(host string) (connection.Connection, error)

Get a item from the cache, protected by mutex

func (*Cache) Login

func (c *Cache) Login(host string, cfg *connection.Config) error

func (*Cache) ReCreate

func (c *Cache) ReCreate(host string, cfg *connection.Config) (connection.Connection, error)

ReCreate a item, protected by mutex

func (*Cache) Remove

func (c *Cache) Remove(host string)

Remove a item from the cache, protected by mutex

Jump to

Keyboard shortcuts

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