model

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadUserProjectConfig

func LoadUserProjectConfig(path string) ap

LoadUserProjectConfig load configuration from file into object

Types

type AC

type AC struct {
	metav1.TypeMeta `json:",inline"`
	ObjectMeta      *metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec            ClusterSpec        `json:"spec,omitempty"`
}

func LoadUserClusterConfig

func LoadUserClusterConfig(path string) AC

LoadUserClusterConfig load configuration into object

func (*AC) ClusterFileName

func (ac *AC) ClusterFileName(input UserInputs) string

func (*AC) GetClusterNameResource

func (ac *AC) GetClusterNameResource() string

type ClusterSpec

type ClusterSpec v1.AtlasClusterSpec

type DBUser

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

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

func NewDBUser

func NewDBUser(userName string) *DBUser

func (*DBUser) AddRole

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

func (*DBUser) GetFilePath

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

func (*DBUser) SaveConfigurationTo

func (s *DBUser) SaveConfigurationTo(folder string)

func (*DBUser) WithAuthDatabase

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

func (*DBUser) WithProjectRef

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

func (*DBUser) WithSecretRef

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

type ISpec

type ISpec interface {
	ProjectName(string) ISpec
	SecretRef(string) ISpec
	WithIpAccess(string, string) ISpec
	CompleteK8sConfig(string) []byte
}

func NewProject

func NewProject() ISpec

type ProjectSpec

type ProjectSpec v1.AtlasProjectSpec

func (ProjectSpec) CompleteK8sConfig

func (s ProjectSpec) CompleteK8sConfig(k8sname string) []byte

func (*ProjectSpec) ProjectName

func (s *ProjectSpec) ProjectName(name string) ISpec

func (*ProjectSpec) SecretRef

func (s *ProjectSpec) SecretRef(name string) ISpec

func (*ProjectSpec) WithIpAccess

func (s *ProjectSpec) WithIpAccess(ipAdress, comment string) ISpec

type UserInputs

type UserInputs struct {
	ProjectName        string
	ProjectID          string
	KeyName            string
	Namespace          string
	K8sProjectName     string
	K8sFullProjectName string
	ProjectPath        string
	Clusters           []AC
	Users              []DBUser
}

TODO PRIVATE?

func NewUserInputs

func NewUserInputs(keyName string, users []DBUser) UserInputs

NewUsersInputs prepare users inputs

func (*UserInputs) GetAppFolder

func (u *UserInputs) GetAppFolder() string

func (*UserInputs) GetOperatorFolder

func (u *UserInputs) GetOperatorFolder() string

func (*UserInputs) GetResourceFolder

func (u *UserInputs) GetResourceFolder() string

func (*UserInputs) GetUsersFolder

func (u *UserInputs) GetUsersFolder() string

type UserSpec

type UserSpec v1.AtlasDatabaseUserSpec

Jump to

Keyboard shortcuts

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