schema

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Copyright © 2021-2023 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2023 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ACCOUNTS_COL = "Accounts"
	ACC2NS       = ACCOUNTS_COL + "2" + NAMESPACES_COL
	ACC2CRED     = ACCOUNTS_COL + "2" + CREDENTIALS_COL

	ROOT_ACCOUNT_KEY = "0"
)
View Source
const (
	NAMESPACES_COL = "Namespaces"
	NS2ACC         = NAMESPACES_COL + "2" + ACCOUNTS_COL

	ROOT_NAMESPACE_KEY = "0"
)
View Source
const (
	CREDENTIALS_COL      = "Credentials"
	CREDENTIALS_EDGE_COL = ACCOUNTS_COL + "2" + CREDENTIALS_COL
)
View Source
const (
	SERVICES_COL         = "Services"
	NS2SERV              = NAMESPACES_COL + "2" + SERVICES_COL
	INSTANCES_GROUPS_COL = "InstancesGroups"
	SERV2IG              = SERVICES_COL + "2" + INSTANCES_GROUPS_COL
	INSTANCES_COL        = "Instances"
	IG2INST              = INSTANCES_GROUPS_COL + "2" + INSTANCES_COL
	CUR_COL              = "Currencies"
	CUR2CUR              = CUR_COL + "2" + CUR_COL
)
View Source
const (
	SERVICES_PROVIDERS_COL = "ServicesProviders"
	SHOWCASES_COL          = "Showcases"
	IG2SP                  = INSTANCES_GROUPS_COL + "2" + SERVICES_PROVIDERS_COL
	SP2BP                  = SERVICES_PROVIDERS_COL + "2" + BILLING_PLANS_COL
)
View Source
const (
	BILLING_PLANS_COL = "BillingPlans"
	TRANSACTIONS_COL  = "Transactions"
	RECORDS_COL       = "Records"
)

Variables

View Source
var BILLING_GRAPH = NoCloudGraphSchema{
	Name: "Billing",
	Edges: [][]string{
		{SERVICES_PROVIDERS_COL, BILLING_PLANS_COL},
		{CUR_COL, CUR_COL},
	},
}
View Source
var CREDENTIALS_GRAPH = NoCloudGraphSchema{
	Name: "Credentials",
	Edges: [][]string{
		{ACCOUNTS_COL, CREDENTIALS_COL},
	},
}
View Source
var (
	DB_NAME = "nocloud"
)

Functions

func CheckAndRegisterCollections

func CheckAndRegisterCollections(log *zap.Logger, db driver.Database, collections []string)

func CheckAndRegisterGraph

func CheckAndRegisterGraph(log *zap.Logger, db driver.Database, graph NoCloudGraphSchema)

func InitDB

func InitDB(log *zap.Logger, dbHost, dbCred, rootPass string)

Types

type NoCloudGraphSchema

type NoCloudGraphSchema struct {
	Name  string
	Edges [][]string
}

Jump to

Keyboard shortcuts

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