kubernetes: k8s.io/kubernetes/pkg/kubelet/util/store Index | Files

package store

import "k8s.io/kubernetes/pkg/kubelet/util/store"

Package store hosts a Store interface and its implementations.

Index

Package Files

doc.go filestore.go store.go

Variables

var (

    // ErrKeyNotFound is the error returned if key is not found in Store.
    ErrKeyNotFound = fmt.Errorf("key is not found")
)

func ValidateKey Uses

func ValidateKey(key string) error

ValidateKey returns an error if the given key does not meet the requirement of the key format and length.

type FileStore Uses

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

FileStore is an implementation of the Store interface which stores data in files.

func (*FileStore) Delete Uses

func (f *FileStore) Delete(key string) error

Delete deletes the key file.

func (*FileStore) List Uses

func (f *FileStore) List() ([]string, error)

List returns all keys in the store.

func (*FileStore) Read Uses

func (f *FileStore) Read(key string) ([]byte, error)

Read reads the data from the file named key.

func (*FileStore) Write Uses

func (f *FileStore) Write(key string, data []byte) error

Write writes the given data to a file named key.

type Store Uses

type Store interface {
    // key must contain one or more characters in [A-Za-z0-9]
    // Write writes data with key.
    Write(key string, data []byte) error
    // Read retrieves data with key
    // Read must return ErrKeyNotFound if key is not found.
    Read(key string) ([]byte, error)
    // Delete deletes data by key
    // Delete must not return error if key does not exist
    Delete(key string) error
    // List lists all existing keys.
    List() ([]string, error)
}

Store provides the interface for storing keyed data. Store must be thread-safe

func NewFileStore Uses

func NewFileStore(path string, fs utilfs.Filesystem) (Store, error)

NewFileStore returns an instance of FileStore.

Package store imports 6 packages (graph) and is imported by 9 packages. Updated 2018-04-20. Refresh now. Tools for package owners.