db

package
v0.0.0-...-bb2f907 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudConfig

type CloudConfig struct {
	Provider  string `json:"cloudConfigClusterProvider"`
	Cluster   string `json:"cloudConfigCluster"`
	Level     string `json:"level"`
	Namespace string `json:"namespace"`
	Config    string `json:"config"`
}

CloudConfig contains the parameters that specify access to a cloud at any level

type CloudConfigClient

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

CloudConfigClient implements CloudConfigManager It will also be used to maintain some localized state

func NewCloudConfigClient

func NewCloudConfigClient() *CloudConfigClient

NewCloudConfigClient returns an instance of the CloudConfigClient which implements CloudConfigManager

func (*CloudConfigClient) CreateCloudConfig

func (c *CloudConfigClient) CreateCloudConfig(ctx context.Context, provider string, cluster string, level string, namespace string, config string) (CloudConfig, error)

CreateCloudConfig allows to create a new cloud config entry to hold a kubeconfig for access

func (*CloudConfigClient) CreateClusterSyncObjects

func (c *CloudConfigClient) CreateClusterSyncObjects(ctx context.Context, provider string, p mtypes.ClusterSyncObjects, exists bool) (mtypes.ClusterSyncObjects, error)

func (*CloudConfigClient) CreateGitOpsConfig

func (c *CloudConfigClient) CreateGitOpsConfig(ctx context.Context, provider string, cluster string, gs mtypes.GitOpsSpec, level string, namespace string) (CloudGitOpsConfig, error)

CreateGitOpsConfig allows to create a new cloud config entry to hold a kubeconfig for access

func (*CloudConfigClient) DeleteCloudConfig

func (c *CloudConfigClient) DeleteCloudConfig(ctx context.Context, provider string, cluster string, level string, namespace string) error

DeleteCloudConfig deletes a cloud config entry

func (*CloudConfigClient) DeleteClusterSyncObjects

func (c *CloudConfigClient) DeleteClusterSyncObjects(ctx context.Context, provider, syncobject string) error

DeleteClusterSyncObjects the ClusterSyncObjects from database

func (*CloudConfigClient) GetAllClusterSyncObjects

func (c *CloudConfigClient) GetAllClusterSyncObjects(ctx context.Context, provider string) ([]mtypes.ClusterSyncObjects, error)

GetAllClusterSyncObjects returns the Cluster Sync Objects for corresponding provider

func (*CloudConfigClient) GetCloudConfig

func (c *CloudConfigClient) GetCloudConfig(ctx context.Context, provider string, cluster string, level string, namespace string) (CloudConfig, error)

GetCloudConfig allows to get an existing cloud config entry

func (*CloudConfigClient) GetClusterSyncObjects

func (c *CloudConfigClient) GetClusterSyncObjects(ctx context.Context, provider, syncobject string) (mtypes.ClusterSyncObjects, error)

GetClusterSyncObjects returns the Cluster Sync objects for corresponding provider and sync object name

func (*CloudConfigClient) GetClusterSyncObjectsValue

func (c *CloudConfigClient) GetClusterSyncObjectsValue(ctx context.Context, provider, syncobject, syncobjectkey string) (interface{}, error)

GetClusterSyncObjectsValue returns the value of the key from the corresponding provider and Sync Object name

func (*CloudConfigClient) GetGitOpsConfig

func (c *CloudConfigClient) GetGitOpsConfig(ctx context.Context, provider string, cluster string, level string, namespace string) (CloudGitOpsConfig, error)

GetGitOpsConfig allows to create a new cloud config entry to hold a kubeconfig for access

func (*CloudConfigClient) GetNamespace

func (c *CloudConfigClient) GetNamespace(ctx context.Context, provider string, cluster string) (string, error)

GetNamespace is only for L0 cloud configs and allows fetching the current namespace name

func (*CloudConfigClient) SetNamespace

func (c *CloudConfigClient) SetNamespace(ctx context.Context, provider string, cluster string, namespace string) error

SetNamespace is only for L0 cloud configs and allows to set/reset current namespace name

type CloudConfigKey

type CloudConfigKey struct {
	Provider  string `json:"cloudConfigClusterProvider"`
	Cluster   string `json:"cloudConfigCluster"`
	Level     string `json:"level"`
	Namespace string `json:"namespace"`
}

ClusterKey is the key structure that is used in the database

type CloudConfigManager

type CloudConfigManager interface {
	GetCloudConfig(provider string, cluster string, level string, namespace string) (CloudConfig, error)
	CreateCloudConfig(provider string, cluster string, level string, namespace string, config string) (CloudConfig, error)
	GetNamespace(provider string, cluster string) (string, error)         // level-0 only
	SetNamespace(provider string, cluster string, namespace string) error // level-0 only
	DeleteCloudConfig(provider string, cluster string, level string, namespace string) error
	CreateClusterSyncObjects(provider string, pr mtypes.ClusterSyncObjects, exists bool) (mtypes.ClusterSyncObjects, error)
	GetClusterSyncObjects(provider, syncobject string) (mtypes.ClusterSyncObjects, error)
	GetClusterSyncObjectsValue(provider, syncobject, syncobjectkey string) (interface{}, error)
	GetAllClusterSyncObjects(provider string) ([]mtypes.ClusterSyncObjects, error)
	DeleteClusterSyncObjects(provider, syncobject string) error
	CreateGitOpsConfig(provider string, cluster string, gs mtypes.GitOpsSpec, level string, namespace string) (CloudGitOpsConfig, error)
	GetGitOpsConfig(provider string, cluster string, level string, namespace string) (CloudGitOpsConfig, error)
}

CloudConfigManager is an interface that exposes the Cloud Config functionality

type CloudGitOpsConfig

type CloudGitOpsConfig struct {
	Provider  string            `json:"cloudConfigClusterProvider"`
	Cluster   string            `json:"cloudConfigCluster"`
	Level     string            `json:"level"`
	Namespace string            `json:"namespace"`
	Config    mtypes.GitOpsSpec `json:"gitOps"`
}

CloudConfig contains the parameters that specify access to a cloud at any level

type ClusterSyncObjectsKey

type ClusterSyncObjectsKey struct {
	ClusterProviderName    string `json:"clusterProvider"`
	ClusterSyncObjectsName string `json:"clusterSyncObject"`
}

ClusterSyncObjectKey is the key structure that is used in the database

type KubeConfig

type KubeConfig struct {
	Config string `json:"config" encrypted:""`
}

Jump to

Keyboard shortcuts

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