Documentation ¶
Overview ¶
Copyright The Pharmer Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright The Pharmer Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("not implemented")
Functions ¶
func RegisterProvider ¶
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) UpdateUUID(obj *api.Cluster, uuid string) (*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) ([]*clusterapi.MachineSet, error) Get(name string) (*clusterapi.MachineSet, error) Create(obj *clusterapi.MachineSet) (*clusterapi.MachineSet, error) Update(obj *clusterapi.MachineSet) (*clusterapi.MachineSet, error) Delete(name string) error UpdateStatus(obj *clusterapi.MachineSet) (*clusterapi.MachineSet, error) }
type MachineStore ¶
type MachineStore interface { List(opts metav1.ListOptions) ([]*clusterapi.Machine, error) Get(name string) (*clusterapi.Machine, error) Create(obj *clusterapi.Machine) (*clusterapi.Machine, error) Update(obj *clusterapi.Machine) (*clusterapi.Machine, error) Delete(name string) error UpdateStatus(obj *clusterapi.Machine) (*clusterapi.Machine, error) }
type OperationStore ¶
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)