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 ¶
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 ¶
func New( ctx context.Context, repo repository.IRepository, dispatcher dispatch.Dispatcher) (APIManager, error)
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.
type TemplateEntityID ¶
type TemplateEntityID struct{}
Click to show internal directories.
Click to hide internal directories.