graph

package
v0.0.14-r11 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

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.

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.

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.

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.

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.

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 (
	INSTANCES_COL = "Instances"
)
View Source
const (
	INSTANCES_GROUPS_COL = "InstancesGroups"
)

Variables

This section is empty.

Functions

func AccessLevel

func AccessLevel(ctx context.Context, db driver.Database, account string, node string) (bool, int32)

account - Account Key, node - DocumentID

func DeleteNodeChildren

func DeleteNodeChildren(ctx context.Context, db driver.Database, node string) error

func HasAccess

func HasAccess(ctx context.Context, db driver.Database, account string, node string, level int32) bool

account - Account Key, node - DocumentID

Types

type Access

type Access struct {
	From  driver.DocumentID `json:"_from"`
	To    driver.DocumentID `json:"_to"`
	Level int32             `json:"level"`
	Role  string            `json:"role"`

	driver.DocumentMeta
}

type Account

type Account struct {
	Title string `json:"title"`
	driver.DocumentMeta
}

func Authorisable

func Authorisable(ctx context.Context, cred *credentials.Credentials, db driver.Database) (Account, bool)

Return Account authorisable by this Credentials

func (*Account) Delete

func (acc *Account) Delete(ctx context.Context, db driver.Database) error

func (*Account) JoinNamespace

func (acc *Account) JoinNamespace(ctx context.Context, edge driver.Collection, ns Namespace, level int32, role string) error

Grant namespace access to account

func (*Account) LinkNamespace

func (acc *Account) LinkNamespace(ctx context.Context, edge driver.Collection, ns Namespace, level int32, role string) error

Grant account access to namespace

type AccountsController

type AccountsController struct {
	// contains filtered or unexported fields
}

func NewAccountsController

func NewAccountsController(log *zap.Logger, db driver.Database) AccountsController

func (*AccountsController) Authorize

func (ctrl *AccountsController) Authorize(ctx context.Context, auth_type string, args ...string) (Account, bool)

func (*AccountsController) Create

func (ctrl *AccountsController) Create(ctx context.Context, title string) (acc Account, err error)

func (*AccountsController) Delete

func (ctrl *AccountsController) Delete(ctx context.Context, id string) error

func (*AccountsController) EnsureRootExists

func (ctrl *AccountsController) EnsureRootExists(passwd string) (err error)

func (*AccountsController) Exists

func (ctrl *AccountsController) Exists(ctx context.Context, id string) (bool, error)

func (*AccountsController) Get

func (ctrl *AccountsController) Get(ctx context.Context, id string) (Account, error)

func (*AccountsController) GetCredentials

func (ctrl *AccountsController) GetCredentials(ctx context.Context, edge_col driver.Collection, acc Account, auth_type string) (key string, has_credentials bool)

func (*AccountsController) List

func (ctrl *AccountsController) List(ctx context.Context, requestor Account, req_depth *int32) ([]Account, error)

func (*AccountsController) SetCredentials

func (ctrl *AccountsController) SetCredentials(ctx context.Context, acc Account, edge driver.Collection, c credentials.Credentials) error

Set Account Credentials, ensure account has only one credentials document linked per credentials type

func (*AccountsController) Update

func (ctrl *AccountsController) Update(ctx context.Context, acc Account, title string) (err error)

func (*AccountsController) UpdateCredentials

func (ctrl *AccountsController) UpdateCredentials(ctx context.Context, cred string, c credentials.Credentials) (err error)

type BillingPlan

type BillingPlan struct {
	*pb.Plan
	driver.DocumentMeta
}

type BillingPlansController

type BillingPlansController struct {
	// contains filtered or unexported fields
}

func NewBillingPlansController

func NewBillingPlansController(log *zap.Logger, db driver.Database) BillingPlansController

func (*BillingPlansController) Create

func (ctrl *BillingPlansController) Create(ctx context.Context, plan *pb.Plan) (*BillingPlan, error)

func (*BillingPlansController) Delete

func (ctrl *BillingPlansController) Delete(ctx context.Context, plan *pb.Plan) (err error)

func (*BillingPlansController) Get

func (ctrl *BillingPlansController) Get(ctx context.Context, plan *pb.Plan) (*BillingPlan, error)
func (ctrl *BillingPlansController) Link(ctx context.Context, uuid string, instances []string) error

func (*BillingPlansController) List

func (ctrl *BillingPlansController) List(ctx context.Context) ([]*BillingPlan, error)

func (*BillingPlansController) Update

func (ctrl *BillingPlansController) Update(ctx context.Context, plan *pb.Plan) (*BillingPlan, error)

type Deletable

type Deletable interface {
	Delete(context.Context, driver.Database) error
}

func MakeDeletable

func MakeDeletable(ctx context.Context, db driver.Database, node Node) (Deletable, error)

type Instance

type Instance struct {
	*pb.Instance
	driver.DocumentMeta
}

type InstancesController

type InstancesController struct {
	// contains filtered or unexported fields
}

func NewInstancesController

func NewInstancesController(log *zap.Logger, db driver.Database) InstancesController

func (*InstancesController) Create

func (ctrl *InstancesController) Create(ctx context.Context, instance *pb.Instance) error

type InstancesGroup added in v0.0.18

type InstancesGroup struct {
	*pb.InstancesGroup
	driver.DocumentMeta
}

type InstancesGroupsController

type InstancesGroupsController struct {
	// contains filtered or unexported fields
}

func NewInstancesGroupsController

func NewInstancesGroupsController(log *zap.Logger, db driver.Database) InstancesGroupsController

func (*InstancesGroupsController) Create

func (ctrl *InstancesGroupsController) Create(ctx context.Context, group *pb.InstancesGroup) error

type Namespace

type Namespace struct {
	Title string `json:"title"`
	driver.DocumentMeta
}

func (*Namespace) Delete

func (ns *Namespace) Delete(ctx context.Context, db driver.Database) error

type NamespacesController

type NamespacesController struct {
	// contains filtered or unexported fields
}

func NewNamespacesController

func NewNamespacesController(log *zap.Logger, db driver.Database) NamespacesController

func (*NamespacesController) Create

func (ctrl *NamespacesController) Create(ctx context.Context, title string) (Namespace, error)

func (*NamespacesController) Delete

func (ctrl *NamespacesController) Delete(ctx context.Context, id string) error

func (*NamespacesController) Get

func (ctrl *NamespacesController) Get(ctx context.Context, id string) (Namespace, error)

func (*NamespacesController) Join

func (ctrl *NamespacesController) Join(ctx context.Context, acc Account, ns Namespace, access int32, role string) error
func (ctrl *NamespacesController) Link(ctx context.Context, acc Account, ns Namespace, access int32, role string) error

func (*NamespacesController) List

func (ctrl *NamespacesController) List(ctx context.Context, requestor Account, req_depth *int32) ([]Namespace, error)

type Node

type Node struct {
	Collection string `json:"collection"`
	Key        string `json:"key"`
}

type Provision

type Provision struct {
	From  driver.DocumentID `json:"_from"`
	To    driver.DocumentID `json:"_to"`
	Group string            `json:"group"`

	driver.DocumentMeta
}

type Record

type Record struct {
	*pb.Transaction
	driver.DocumentMeta
}

type RecordsController

type RecordsController struct {
	// contains filtered or unexported fields
}

func NewRecordsController

func NewRecordsController(log *zap.Logger, db driver.Database) RecordsController

type Service added in v0.0.18

type Service struct {
	*pb.Service
	driver.DocumentMeta
}

type ServicesController

type ServicesController struct {
	// contains filtered or unexported fields
}

func NewServicesController

func NewServicesController(log *zap.Logger, db driver.Database) ServicesController

func (*ServicesController) Create

func (ctrl *ServicesController) Create(ctx context.Context, service *pb.Service) (*Service, error)

Create Service and underlaying entities and store in DB

func (*ServicesController) Delete

func (ctrl *ServicesController) Delete(ctx context.Context, s *Service) (err error)

func (*ServicesController) FindServiceByInstance

func (ctrl *ServicesController) FindServiceByInstance(ctx context.Context, instance string) (*Service, error)

Returns Service by one of it's Instances UUID

func (*ServicesController) Get

func (ctrl *ServicesController) Get(ctx context.Context, id string) (*Service, error)

Get Service from DB

func (*ServicesController) GetProvisions

func (ctrl *ServicesController) GetProvisions(ctx context.Context, service string) (r map[string]string, err error)

Get Provisions, map of InstancesGroups to ServicesProviders, those groups are deployed to

func (*ServicesController) Join

func (ctrl *ServicesController) Join(ctx context.Context, service *Service, namespace *Namespace, access int32, role string) error

Join Service into Namespace

func (*ServicesController) List

func (ctrl *ServicesController) List(ctx context.Context, requestor string, request *pb.ListRequest) ([]*Service, error)

List Services in DB

func (*ServicesController) Provide

func (ctrl *ServicesController) Provide(ctx context.Context, sp, service driver.DocumentID, group string) error

Create Link between Service/Group and Services Provider group is Provisioned(deployed) to

func (*ServicesController) SetStatus

func (ctrl *ServicesController) SetStatus(ctx context.Context, s *Service, status string) (err error)

func (*ServicesController) Unprovide

func (ctrl *ServicesController) Unprovide(ctx context.Context, group string) (err error)

Delete Link between Service/Group and Services Provider group have beem Unprovisioned(undeployed) from

func (*ServicesController) Update

func (ctrl *ServicesController) Update(ctx context.Context, service *pb.Service, hash bool) error

Update Service and underlaying entities and store in DB

type ServicesProvider

type ServicesProvider struct {
	*pb.ServicesProvider
	driver.DocumentMeta
}

type ServicesProvidersController

type ServicesProvidersController struct {
	// contains filtered or unexported fields
}

func NewServicesProvidersController

func NewServicesProvidersController(log *zap.Logger, db driver.Database) ServicesProvidersController

func (*ServicesProvidersController) Create

func (ctrl *ServicesProvidersController) Create(ctx context.Context, sp *ServicesProvider) (err error)

func (*ServicesProvidersController) Delete

func (ctrl *ServicesProvidersController) Delete(ctx context.Context, id string) (err error)

func (*ServicesProvidersController) Get

func (*ServicesProvidersController) List

func (ctrl *ServicesProvidersController) List(ctx context.Context, requestor string) ([]*ServicesProvider, error)

List Services Providers in DB

func (*ServicesProvidersController) ListDeployments

func (ctrl *ServicesProvidersController) ListDeployments(ctx context.Context, sp *ServicesProvider) ([]*Service, error)

func (*ServicesProvidersController) Update

Update ServicesProvider in DB

type Transaction

type Transaction struct {
	*pb.Transaction
	driver.DocumentMeta
}

type TransactionsController

type TransactionsController struct {
	// contains filtered or unexported fields
}

func NewTransactionsController

func NewTransactionsController(log *zap.Logger, db driver.Database) TransactionsController

func (*TransactionsController) Create

Jump to

Keyboard shortcuts

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