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
- func AccessLevel(ctx context.Context, db driver.Database, account string, node string) (bool, int32)
- func DeleteNodeChildren(ctx context.Context, db driver.Database, node string) error
- func HasAccess(ctx context.Context, db driver.Database, account string, node string, ...) bool
- type Access
- type Account
- func (acc *Account) Delete(ctx context.Context, db driver.Database) error
- func (acc *Account) JoinNamespace(ctx context.Context, edge driver.Collection, ns Namespace, level int32, ...) error
- func (acc *Account) LinkNamespace(ctx context.Context, edge driver.Collection, ns Namespace, level int32, ...) error
- type AccountsController
- func (ctrl *AccountsController) Authorize(ctx context.Context, auth_type string, args ...string) (Account, bool)
- func (ctrl *AccountsController) Create(ctx context.Context, title string) (acc Account, err error)
- func (ctrl *AccountsController) Delete(ctx context.Context, id string) error
- func (ctrl *AccountsController) EnsureRootExists(passwd string) (err error)
- func (ctrl *AccountsController) Exists(ctx context.Context, id string) (bool, error)
- func (ctrl *AccountsController) Get(ctx context.Context, id string) (Account, error)
- func (ctrl *AccountsController) GetCredentials(ctx context.Context, edge_col driver.Collection, acc Account, auth_type string) (key string, has_credentials bool)
- func (ctrl *AccountsController) List(ctx context.Context, requestor Account, req_depth *int32) ([]Account, error)
- func (ctrl *AccountsController) SetCredentials(ctx context.Context, acc Account, edge driver.Collection, ...) error
- func (ctrl *AccountsController) Update(ctx context.Context, acc Account, title string) (err error)
- func (ctrl *AccountsController) UpdateCredentials(ctx context.Context, cred string, c credentials.Credentials) (err error)
- type BillingPlan
- type BillingPlansController
- func (ctrl *BillingPlansController) Create(ctx context.Context, plan *pb.Plan) (*BillingPlan, error)
- func (ctrl *BillingPlansController) Delete(ctx context.Context, plan *pb.Plan) (err error)
- 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 (ctrl *BillingPlansController) List(ctx context.Context) ([]*BillingPlan, error)
- func (ctrl *BillingPlansController) Update(ctx context.Context, plan *pb.Plan) (*BillingPlan, error)
- type Deletable
- type Instance
- type InstancesController
- type InstancesGroup
- type InstancesGroupsController
- type Namespace
- type NamespacesController
- func (ctrl *NamespacesController) Create(ctx context.Context, title string) (Namespace, error)
- func (ctrl *NamespacesController) Delete(ctx context.Context, id string) error
- func (ctrl *NamespacesController) Get(ctx context.Context, id string) (Namespace, error)
- 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 (ctrl *NamespacesController) List(ctx context.Context, requestor Account, req_depth *int32) ([]Namespace, error)
- type Node
- type Provision
- type Record
- type RecordsController
- type Service
- type ServicesController
- func (ctrl *ServicesController) Create(ctx context.Context, service *pb.Service) (*Service, error)
- func (ctrl *ServicesController) Delete(ctx context.Context, s *Service) (err error)
- func (ctrl *ServicesController) FindServiceByInstance(ctx context.Context, instance string) (*Service, error)
- func (ctrl *ServicesController) Get(ctx context.Context, id string) (*Service, error)
- func (ctrl *ServicesController) GetProvisions(ctx context.Context, service string) (r map[string]string, err error)
- func (ctrl *ServicesController) Join(ctx context.Context, service *Service, namespace *Namespace, access int32, ...) error
- func (ctrl *ServicesController) List(ctx context.Context, requestor string, request *pb.ListRequest) ([]*Service, error)
- func (ctrl *ServicesController) Provide(ctx context.Context, sp, service driver.DocumentID, group string) error
- func (ctrl *ServicesController) SetStatus(ctx context.Context, s *Service, status string) (err error)
- func (ctrl *ServicesController) Unprovide(ctx context.Context, group string) (err error)
- func (ctrl *ServicesController) Update(ctx context.Context, service *pb.Service, hash bool) error
- type ServicesProvider
- type ServicesProvidersController
- func (ctrl *ServicesProvidersController) Create(ctx context.Context, sp *ServicesProvider) (err error)
- func (ctrl *ServicesProvidersController) Delete(ctx context.Context, id string) (err error)
- func (ctrl *ServicesProvidersController) Get(ctx context.Context, id string) (r *ServicesProvider, err error)
- func (ctrl *ServicesProvidersController) List(ctx context.Context, requestor string) ([]*ServicesProvider, error)
- func (ctrl *ServicesProvidersController) ListDeployments(ctx context.Context, sp *ServicesProvider) ([]*Service, error)
- func (ctrl *ServicesProvidersController) Update(ctx context.Context, sp *pb.ServicesProvider) error
- type Transaction
- type TransactionsController
Constants ¶
const (
INSTANCES_COL = "Instances"
)
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 ¶
Types ¶
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
type AccountsController ¶
type AccountsController struct {
// contains filtered or unexported fields
}
func NewAccountsController ¶
func NewAccountsController(log *zap.Logger, db driver.Database) AccountsController
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) GetCredentials ¶
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) UpdateCredentials ¶
func (ctrl *AccountsController) UpdateCredentials(ctx context.Context, cred string, c credentials.Credentials) (err error)
type BillingPlan ¶
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) Get ¶
func (ctrl *BillingPlansController) Get(ctx context.Context, plan *pb.Plan) (*BillingPlan, 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 InstancesController ¶
type InstancesController struct {
// contains filtered or unexported fields
}
func NewInstancesController ¶
func NewInstancesController(log *zap.Logger, db driver.Database) InstancesController
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 NamespacesController ¶
type NamespacesController struct {
// contains filtered or unexported fields
}
func NewNamespacesController ¶
func NewNamespacesController(log *zap.Logger, db driver.Database) NamespacesController
func (*NamespacesController) Delete ¶
func (ctrl *NamespacesController) Delete(ctx context.Context, id string) error
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 ServicesController ¶
type ServicesController struct {
// contains filtered or unexported fields
}
func NewServicesController ¶
func NewServicesController(log *zap.Logger, db driver.Database) ServicesController
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) 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
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 (ctrl *ServicesProvidersController) Get(ctx context.Context, id string) (r *ServicesProvider, err error)
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 ¶
func (ctrl *ServicesProvidersController) Update(ctx context.Context, sp *pb.ServicesProvider) error
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 ¶
func (ctrl *TransactionsController) Create(ctx context.Context, tx *pb.Transaction) (*Transaction, error)