utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertYAMLtoJSONHelper

func ConvertYAMLtoJSONHelper(i interface{}) interface{}

ConvertYAMLtoJSONHelper converts the yaml to json recursively

func CopyFile

func CopyFile(source, target string)

func GenUniqID

func GenUniqID() string

func JSONToYAMLConvert

func JSONToYAMLConvert(cnfg interface{}) []byte

func LoadUserProjectConfig

func LoadUserProjectConfig(path string) *v1.AtlasProject

LoadUserProjectConfig load configuration into object

func ReadInYAMLFileAndConvert

func ReadInYAMLFileAndConvert(pathToYamlFile string, cnfg interface{}) interface{}

ReadInYAMLFileAndConvert reads in the yaml file given by the path given

func SaveToFile

func SaveToFile(path string, data []byte) error

Types

type DBUser added in v0.5.0

type DBUser struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec UserSpec `json:"spec,omitempty"`
}

func NewDBUser added in v0.5.0

func NewDBUser(userName string) *DBUser

func (*DBUser) AddRole added in v0.5.0

func (s *DBUser) AddRole(role string, db string, collection string) *DBUser

func (*DBUser) GetFilePath added in v0.5.0

func (s *DBUser) GetFilePath(ns string) string

func (*DBUser) SaveConfigurationTo added in v0.5.0

func (s *DBUser) SaveConfigurationTo(ns string)

func (*DBUser) WithAuthDatabase added in v0.5.0

func (u *DBUser) WithAuthDatabase(name string) *DBUser

func (*DBUser) WithProjectRef added in v0.5.0

func (s *DBUser) WithProjectRef(name string) *DBUser

func (*DBUser) WithSecretRef added in v0.5.0

func (s *DBUser) WithSecretRef(name string) *DBUser

type UserSpec added in v0.5.0

type UserSpec v1.AtlasDatabaseUserSpec

Jump to

Keyboard shortcuts

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