db

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

This section is empty.

Variables

View Source
var Client = Connect()

Functions

This section is empty.

Types

type EstablishConnectArgs added in v0.0.3

type EstablishConnectArgs struct {
	Tries  int
	Silent bool
}

type MongoDBClient

type MongoDBClient struct {
	Client                  *mongo.Client
	Context                 context.Context
	ClustersCollection      *mongo.Collection
	GitopsCatalogCollection *mongo.Collection
	ServicesCollection      *mongo.Collection
	EnvironmentsCollection  *mongo.Collection
}

func Connect

func Connect() *MongoDBClient

Connect

func (*MongoDBClient) CreateClusterServiceList

func (mdbcl *MongoDBClient) CreateClusterServiceList(clusterName string) error

CreateClusterServiceList adds an entry for a cluster to the service list

func (*MongoDBClient) DeleteCluster

func (mdbcl *MongoDBClient) DeleteCluster(clusterName string) error

DeleteCluster

func (*MongoDBClient) DeleteClusterServiceListEntry

func (mdbcl *MongoDBClient) DeleteClusterServiceListEntry(clusterName string, def *types.Service) error

DeleteClusterServiceListEntry removes a service entry from a cluster's service list

func (*MongoDBClient) DeleteEnvironment added in v0.0.3

func (mdbcl *MongoDBClient) DeleteEnvironment(envId string) error

func (*MongoDBClient) EstablishMongoConnection added in v0.0.3

func (mdbcl *MongoDBClient) EstablishMongoConnection(args EstablishConnectArgs) error

func (*MongoDBClient) GetCluster

func (mdbcl *MongoDBClient) GetCluster(clusterName string) (pkgtypes.Cluster, error)

GetCluster

func (*MongoDBClient) GetClusters

func (mdbcl *MongoDBClient) GetClusters() ([]pkgtypes.Cluster, error)

GetClusters

func (*MongoDBClient) GetEnvironment added in v0.0.3

func (mdbcl *MongoDBClient) GetEnvironment(name string) (pkgtypes.Environment, error)

GetEnvironment

func (*MongoDBClient) GetEnvironments added in v0.0.3

func (mdbcl *MongoDBClient) GetEnvironments() ([]pkgtypes.Environment, error)

GetEnvironments

func (*MongoDBClient) GetGitopsCatalogApps

func (mdbcl *MongoDBClient) GetGitopsCatalogApps() (types.GitopsCatalogApps, error)

GetGitopsCatalogApps

func (*MongoDBClient) GetGitopsCatalogAppsByCloudProvider added in v0.1.20

func (mdbcl *MongoDBClient) GetGitopsCatalogAppsByCloudProvider(cloudProvider string, gitProvider string) (types.GitopsCatalogApps, error)

GetGitopsCatalogAppsByCloudProvider

func (*MongoDBClient) GetService

func (mdbcl *MongoDBClient) GetService(clusterName string, serviceName string) (types.Service, error)

GetService returns a single service associated with a given cluster

func (*MongoDBClient) GetServices

func (mdbcl *MongoDBClient) GetServices(clusterName string) (types.ClusterServiceList, error)

GetServices returns services associated with a given cluster

func (*MongoDBClient) ImportClusterIfEmpty added in v0.0.3

func (mdbcl *MongoDBClient) ImportClusterIfEmpty(silent bool) (pkgtypes.Cluster, error)

ImportClusterIfEmpty

func (*MongoDBClient) InsertCluster

func (mdbcl *MongoDBClient) InsertCluster(cl pkgtypes.Cluster) error

InsertCluster

func (*MongoDBClient) InsertClusterServiceListEntry

func (mdbcl *MongoDBClient) InsertClusterServiceListEntry(clusterName string, def *types.Service) error

InsertClusterServiceListEntry appends a service entry for a cluster's service list

func (*MongoDBClient) InsertEnvironment added in v0.0.3

func (mdbcl *MongoDBClient) InsertEnvironment(env pkgtypes.Environment) (pkgtypes.Environment, error)

InsertEnvironment

func (*MongoDBClient) TestDatabaseConnection

func (mdbcl *MongoDBClient) TestDatabaseConnection(silent bool) error

TestDatabaseConnection

func (*MongoDBClient) UpdateCluster

func (mdbcl *MongoDBClient) UpdateCluster(clusterName string, field string, value interface{}) error

UpdateCluster

func (*MongoDBClient) UpdateEnvironment added in v0.0.4

func (mdbcl *MongoDBClient) UpdateEnvironment(id string, env types.EnvironmentUpdateRequest) error

func (*MongoDBClient) UpdateGitopsCatalogApps

func (mdbcl *MongoDBClient) UpdateGitopsCatalogApps() error

UpdateGitopsCatalogApps

Jump to

Keyboard shortcuts

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