claudieDB

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaudieMongo

type ClaudieMongo struct {
	URL string
	// contains filtered or unexported fields
}

func (*ClaudieMongo) Connect

func (c *ClaudieMongo) Connect() error

Connect tries to connect to the mongo DB until maxConnectionRetries reached if successful, returns mongo client, error otherwise

func (*ClaudieMongo) DeleteConfig

func (c *ClaudieMongo) DeleteConfig(id string, idType pb.IdType) error

Delete config deletes a config from database permanently returns error if not successful, nil otherwise

func (*ClaudieMongo) Disconnect

func (c *ClaudieMongo) Disconnect() error

Disconnect closes the connection to MongoDB returns error if closing was not successful

func (*ClaudieMongo) GetAllConfigs

func (c *ClaudieMongo) GetAllConfigs() ([]*pb.Config, error)

GetAllConfig gets all configs from database returns slice of pb.Config if successful, error otherwise

func (*ClaudieMongo) GetConfig

func (c *ClaudieMongo) GetConfig(id string, idType pb.IdType) (*pb.Config, error)

GetConfig will get the config from the database, based on id and id type returns error if not successful, nil otherwise

func (*ClaudieMongo) Init

func (c *ClaudieMongo) Init() error

Init will initialise database and collections returns error if initialisation failed, nil otherwise

func (*ClaudieMongo) SaveConfig

func (c *ClaudieMongo) SaveConfig(config *pb.Config) error

SaveConfig will save specified config in the database if config has been encountered before, based on id and name, it will update existing record return error if not successful, nil otherwise

func (*ClaudieMongo) UpdateBuilderTTL

func (c *ClaudieMongo) UpdateBuilderTTL(name string, newTTL int32) error

UpdateBuilderTTL will update a builderTTL based on the name of the config returns error if not successful, nil otherwise

func (*ClaudieMongo) UpdateCs

func (c *ClaudieMongo) UpdateCs(config *pb.Config) error

UpdateCs will update the current state related field in DB

func (*ClaudieMongo) UpdateDs

func (c *ClaudieMongo) UpdateDs(config *pb.Config) error

UpdateDs will update the desired state related field in DB

func (*ClaudieMongo) UpdateMsToNull

func (c *ClaudieMongo) UpdateMsToNull(hexId string) error

UpdateMsToNull will update the msChecksum and manifest based on the id of the config returns error if not successful, nil otherwise

func (*ClaudieMongo) UpdateSchedulerTTL

func (c *ClaudieMongo) UpdateSchedulerTTL(name string, newTTL int32) error

UpdateSchedulerTTL will update a schedulerTTL based on the name of the config returns error if not successful, nil otherwise

Jump to

Keyboard shortcuts

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