cache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CacheDir is used By default for caching CNI network state
	CacheDir = "/var/lib/cni/rdma"
)

Functions

This section is empty.

Types

type FileSystemOps

type FileSystemOps interface {
	// Eqivalent to ioutil.ReadFile(...)
	ReadFile(filename string) ([]byte, error)
	// Eqivalent to ioutil.WriteFile(...)
	WriteFile(filename string, data []byte, perm os.FileMode) error
	// Eqivalent to os.MkdirAll(...)
	MkdirAll(path string, perm os.FileMode) error
	// Equivalent to os.Remove(...)
	Remove(name string) error
	// Equvalent to os.Stat(...)
	Stat(name string) (os.FileInfo, error)
}

interface consolidating all file system operations

type FsStateCache

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

func (*FsStateCache) Delete

func (sc *FsStateCache) Delete(ref StateRef) error

func (*FsStateCache) GetStateRef

func (sc *FsStateCache) GetStateRef(network, cid, ifname string) StateRef

func (*FsStateCache) Load

func (sc *FsStateCache) Load(ref StateRef, state interface{}) error

func (*FsStateCache) Save

func (sc *FsStateCache) Save(ref StateRef, state interface{}) error

type StateCache

type StateCache interface {
	// Get State reference identifier for <networkName, containerID, interfaceName>
	GetStateRef(network string, cid string, ifname string) StateRef
	// Save state to cache
	Save(ref StateRef, state interface{}) error
	// Load state from cache
	Load(ref StateRef, state interface{}) error
	// Delete state from cache
	Delete(ref StateRef) error
}

func NewStateCache

func NewStateCache() StateCache

Create a new RDMA state Cache that will Save/Load state

type StateRef

type StateRef string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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