store

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

Functions

func RegisterProvider

func RegisterProvider(name string, cloud Factory)

RegisterProvider registers a storage.Factory by name. This is expected to happen during app startup.

Types

type CertificateStore

type CertificateStore interface {
	Get(name string) (*x509.Certificate, *rsa.PrivateKey, error)
	Create(name string, crt *x509.Certificate, key *rsa.PrivateKey) error
	Delete(name string) error
}

type ClusterStore

type ClusterStore interface {
	List(opts metav1.ListOptions) ([]*api.Cluster, error)
	Get(name string) (*api.Cluster, error)
	Create(obj *api.Cluster) (*api.Cluster, error)
	Update(obj *api.Cluster) (*api.Cluster, error)
	Delete(name string) error
	UpdateStatus(obj *api.Cluster) (*api.Cluster, error)
}

type CredentialStore

type CredentialStore interface {
	List(opts metav1.ListOptions) ([]*cloudapi.Credential, error)
	Get(name string) (*cloudapi.Credential, error)
	Create(obj *cloudapi.Credential) (*cloudapi.Credential, error)
	Update(obj *cloudapi.Credential) (*cloudapi.Credential, error)
	Delete(name string) error
}

type Factory

type Factory func(cfg *api.PharmerConfig) (Interface, error)

Factory is a function that returns a storage.Interface. The config parameter provides an io.Reader handler to the factory in order to load specific configurations. If no configuration is provided the parameter is nil.

type Interface

type Interface interface {
	Owner(int64) ResourceInterface
	ResourceInterface
}

func NewStoreInterface

func NewStoreInterface(cfg *api.PharmerConfig) (Interface, error)

type MachineSetStore

type MachineSetStore interface {
	List(opts metav1.ListOptions) ([]*clusterv1.MachineSet, error)
	Get(name string) (*clusterv1.MachineSet, error)
	Create(obj *clusterv1.MachineSet) (*clusterv1.MachineSet, error)
	Update(obj *clusterv1.MachineSet) (*clusterv1.MachineSet, error)
	Delete(name string) error
	UpdateStatus(obj *clusterv1.MachineSet) (*clusterv1.MachineSet, error)
}

type MachineStore

type MachineStore interface {
	List(opts metav1.ListOptions) ([]*clusterv1.Machine, error)
	Get(name string) (*clusterv1.Machine, error)
	Create(obj *clusterv1.Machine) (*clusterv1.Machine, error)
	Update(obj *clusterv1.Machine) (*clusterv1.Machine, error)
	Delete(name string) error
	UpdateStatus(obj *clusterv1.Machine) (*clusterv1.Machine, error)
}

type OperationStore

type OperationStore interface {
	Get(id string) (*api.Operation, error)
	Update(obj *api.Operation) (*api.Operation, error)
}

type ResourceInterface

type ResourceInterface interface {
	Credentials() CredentialStore

	Operations() OperationStore
	Clusters() ClusterStore
	Machine(cluster string) MachineStore
	MachineSet(cluster string) MachineSetStore
	Certificates(cluster string) CertificateStore
	SSHKeys(cluster string) SSHKeyStore
}

func GetStoreProvider

func GetStoreProvider(cmd *cobra.Command) (ResourceInterface, error)

func NewStoreProvider

func NewStoreProvider(cfg *api.PharmerConfig) (ResourceInterface, error)

type SSHKeyStore

type SSHKeyStore interface {
	Get(name string) (pubKey, privKey []byte, err error)
	Create(name string, pubKey, privKey []byte) error
	Delete(name string) error
}

Directories

Path Synopsis
vfs

Jump to

Keyboard shortcuts

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