manager

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright 2021 The tKeel Authors.

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 CoreAPISender = "core.api"

Variables

View Source
var (
	ErrMapperTQLInvalid    = errors.New("invalid TQL")
	ErrEntityNotFound      = errors.New("not found")
	ErrEntityAreadyExisted = errors.New("entity already existed")
)

Functions

This section is empty.

Types

type APIManager

type APIManager interface {
	// Start start Entity manager.
	Start() error
	// OnRespond handle message.
	OnRespond(context.Context, *holder.Response)
	// CreateEntity create entity.
	UpdateEntity(context.Context, *Base) (*Base, error)
	// UpdateEntity update entity.
	CreateEntity(context.Context, *Base) (*Base, error)
	// DeleteEntity delete entity.
	DeleteEntity(context.Context, *Base) error
	// GetProperties returns entity properties.
	GetEntity(context.Context, *Base) (*Base, error)
	// SetProperties set entity properties.
	UpdateEntityProps(context.Context, *Base) (*Base, error)
	// PatchEntity patch entity properties.
	PatchEntityProps(context.Context, *Base, []state.PatchData) (*Base, error)
	// GetEntityProps returns entity configs.
	GetEntityProps(context.Context, *Base, []string) (*Base, error)
	// SetConfigs set entity configs.
	UpdateEntityConfigs(context.Context, *Base) (*Base, error)
	// PatchConfigs patch entity configs.
	PatchEntityConfigs(context.Context, *Base, []state.PatchData) (*Base, error)
	// GetEntityConfigs returns entity configs.
	GetEntityConfigs(context.Context, *Base, []string) (*Base, error)
	// AppendMapper append entity mapper.
	AppendMapper(context.Context, *dao.Mapper) error
	// RemoveMapper remove entity mapper.
	RemoveMapper(context.Context, *dao.Mapper) error
	// GetMapper returns entity mapper.
	GetMapper(context.Context, *dao.Mapper) (*dao.Mapper, error)
	// ListMapper returns entity mappers.
	ListMapper(context.Context, *Base) ([]dao.Mapper, error)
	// CheckSubscription check subscription.
	CheckSubscription(context.Context, *Base) error
}

func New

type Base

type Base struct {
	ID         string                        `json:"id" msgpack:"id" mapstructure:"id"`
	Type       string                        `json:"type" msgpack:"type" mapstructure:"type"`
	Owner      string                        `json:"owner" msgpack:"owner" mapstructure:"owner"`
	Source     string                        `json:"source" msgpack:"source" mapstructure:"source"`
	Version    int64                         `json:"version" msgpack:"version" mapstructure:"version"`
	LastTime   int64                         `json:"last_time" msgpack:"last_time" mapstructure:"last_time"`
	Mappers    []state.Mapper                `json:"mappers" msgpack:"mappers" mapstructure:"mappers"`
	TemplateID string                        `json:"template_id" msgpack:"template_id" mapstructure:"template_id"`
	Properties map[string]tdtl.Node          `json:"properties" msgpack:"properties" mapstructure:"-"`
	Configs    map[string]*constraint.Config `json:"configs" msgpack:"-" mapstructure:"-"`
	ConfigFile []byte                        `json:"-" msgpack:"config_file" mapstructure:"-"`
}

EntityBase state basic informatinon.

func (*Base) Basic

func (b *Base) Basic() Base

func (*Base) JSON

func (b *Base) JSON() map[string]interface{}

type TemplateEntityID

type TemplateEntityID struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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