db

package
v0.0.0-...-f99fb5f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Open(filename string) error
	Close() error
	DropDB() error

	// VPC
	PutVPC(vpc *types.VPC) error
	GetVPC(id string) (*types.VPC, error)
	ListVPCs() ([]*types.VPC, error)
	DeleteVPC(id string) error

	// Instance
	PutInstance(instance *types.Instance) error
	GetInstance(id string) (*types.Instance, error)
	ListInstances() ([]*types.Instance, error)
	DeleteInstance(id string) error

	//Subnet
	PutSubnet(subnet *types.Subnet) error
	GetSubnet(id string) (*types.Subnet, error)
	ListSubnets() ([]*types.Subnet, error)
	DeleteSubnet(id string) error

	//ACL
	PutACL(acl *types.ACL) error
	GetACL(id string) (*types.ACL, error)
	ListACLs() ([]*types.ACL, error)
	DeleteACL(id string) error

	// RouteTable
	PutRouteTable(routeTable *types.RouteTable) error
	GetRouteTable(id string) (*types.RouteTable, error)
	ListRouteTables() ([]*types.RouteTable, error)
	DeleteRouteTable(id string) error

	// NAT Gatweay
	ListNATGateways() ([]*types.NATGateway, error)
	PutNATGateway(ng *types.NATGateway) error
	GetNATGateway(id string) (*types.NATGateway, error)
	DeleteNATGateway(id string) error

	// Router
	ListRouters() ([]*types.Router, error)
	PutRouter(ng *types.Router) error
	GetRouter(id string) (*types.Router, error)
	DeleteRouter(id string) error

	// IGW
	ListInternetGateways() ([]*types.IGW, error)
	PutIGW(ng *types.IGW) error
	GetIGW(id string) (*types.IGW, error)
	DeleteIGW(id string) error

	//Security Group
	PutSecurityGroup(securityGroup *types.SecurityGroup) error
	GetSecurityGroup(id string) (*types.SecurityGroup, error)
	ListSecurityGroups() ([]*types.SecurityGroup, error)
	DeleteSecurityGroup(id string) error

	//  Cluster
	PutCluster(cluster *types.Cluster) error
	GetCluster(id string) (*types.Cluster, error)
	ListClusters() ([]*types.Cluster, error)
	DeleteCluster(id string) error
	// Pods
	PutPod(pod *types.Pod) error
	GetPod(id string) (*types.Pod, error)
	ListPods() ([]*types.Pod, error)
	DeletePod(id string) error
	//Services
	PutKubernetesService(service *types.K8SService) error
	GetKubernetesService(id string) (*types.K8SService, error)
	ListKubernetesServices() ([]*types.K8SService, error)
	DeleteKubernetesService(id string) error
	// Nodes
	PutKubernetesNode(node *types.K8sNode) error
	GetKubernetesNode(id string) (*types.K8sNode, error)
	ListKubernetesNodes() ([]*types.K8sNode, error)
	DeleteKubernetesNode(id string) error

	//Namespaces
	PutNamespace(namespace *types.Namespace) error
	GetNamespace(id string) (*types.Namespace, error)
	ListNamespaces() ([]*types.Namespace, error)
	DeleteNamespace(id string) error

	// Time
	PutSyncTime(time *types.SyncTime) error
	GetSyncTime(id string) (*types.SyncTime, error)
	ListSyncTimes() ([]*types.SyncTime, error)
	DeleteSyncTime(id string) error
}

func NewBoltClient

func NewBoltClient() Client

type DbObject

type DbObject interface {
	DbId() string
	GetProvider() string
	SetSyncTime(string)
}

type KubernetesProviderWithDB

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

func (*KubernetesProviderWithDB) GetSyncTime

func (p *KubernetesProviderWithDB) GetSyncTime(id string) (types.SyncTime, error)

func (*KubernetesProviderWithDB) ListClusters

func (p *KubernetesProviderWithDB) ListClusters(ctx context.Context) ([]types.Cluster, error)

func (*KubernetesProviderWithDB) ListNamespaces

func (p *KubernetesProviderWithDB) ListNamespaces(ctx context.Context, clusterName string, labels map[string]string) ([]types.Namespace, error)

func (*KubernetesProviderWithDB) ListNodes

func (p *KubernetesProviderWithDB) ListNodes(ctx context.Context, clusterName string, labels map[string]string) ([]types.K8sNode, error)

func (*KubernetesProviderWithDB) ListPods

func (p *KubernetesProviderWithDB) ListPods(ctx context.Context, clusterName string, labels map[string]string) ([]types.Pod, error)

func (*KubernetesProviderWithDB) ListPodsCIDRs

func (p *KubernetesProviderWithDB) ListPodsCIDRs(ctx context.Context, clusterName string) ([]string, error)

func (*KubernetesProviderWithDB) ListServices

func (p *KubernetesProviderWithDB) ListServices(ctx context.Context, clusterName string, labels map[string]string) ([]types.K8SService, error)

func (*KubernetesProviderWithDB) ListServicesCIDRs

func (p *KubernetesProviderWithDB) ListServicesCIDRs(ctx context.Context, clusterName string) (string, error)

func (*KubernetesProviderWithDB) UpdateServiceSourceRanges

func (p *KubernetesProviderWithDB) UpdateServiceSourceRanges(ctx context.Context, clusterName, namespace, name string, cidrsToAdd []string, cidrsToRemove []string) error

type StrategyWithDB

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

func NewStrategyWithDB

func NewStrategyWithDB(dbClient Client, providerStrategy provider.Strategy, logger *logrus.Logger) *StrategyWithDB

func (*StrategyWithDB) GetAllProviders

func (s *StrategyWithDB) GetAllProviders() []provider.CloudProvider

func (*StrategyWithDB) GetKubernetesProvider

func (s *StrategyWithDB) GetKubernetesProvider() (provider.Kubernetes, error)

func (*StrategyWithDB) GetProvider

func (s *StrategyWithDB) GetProvider(ctx context.Context, cloud string) (provider.CloudProvider, error)

func (*StrategyWithDB) RefreshState

func (s *StrategyWithDB) RefreshState(ctx context.Context) error

Jump to

Keyboard shortcuts

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