schema

package
v0.0.13-r1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Overview

Copyright © 2021-2022 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-2022 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
	SP2SERV      = SERVICES_PROVIDERS_COL + "2" + SERVICES_COL
)
View Source
const (
	SERVICES_PROVIDERS_COL = "ServicesProviders"
)

Variables

View Source
var CREDENTIALS_GRAPH = NoCloudGraphSchema{
	Name: "Credentials",
	Edges: [][]string{
		{ACCOUNTS_COL, CREDENTIALS_COL},
	},
}
View Source
var (
	DB_NAME = "nocloud"
)
View Source
var PERMISSIONS_GRAPH = NoCloudGraphSchema{
	Name: "Permissions",
	Edges: [][]string{
		{ACCOUNTS_COL, NAMESPACES_COL},
		{NAMESPACES_COL, ACCOUNTS_COL},
		{NAMESPACES_COL, SERVICES_COL},
	},
}
View Source
var SERVICES_GRAPH = NoCloudGraphSchema{
	Name: "Services",
	Edges: [][]string{
		{SERVICES_PROVIDERS_COL, SERVICES_COL},
	},
}

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