config

package
v0.0.0-...-d4d4b81 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfig

func CreateConfig(ctx context.Context, config *ServerConfig, mongodbOperator mongodb.MongoOperator) error

CreateConfig creates a new server config with unique key

func UpdateConfig

func UpdateConfig(ctx context.Context, key string, value interface{}, mongodbOperator mongodb.MongoOperator) error

UpdateConfig updates the required server config

Types

type ServerConfig

type ServerConfig struct {
	Key   string      `bson:"key"`
	Value interface{} `bson:"value"`
}

ServerConfig stores any server specific configuration in the db

func GetConfig

func GetConfig(ctx context.Context, key string, mongodbOperator mongodb.MongoOperator) (*ServerConfig, error)

GetConfig returns the requested server config

Jump to

Keyboard shortcuts

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