Documentation ¶
Index ¶
- Constants
- type ClusterNamespacedName
- type Field
- type FieldIndex
- type FieldType
- type Meta
- func (om *Meta) GetClusterID() string
- func (om *Meta) GetCreateTime() time.Time
- func (om *Meta) GetName() string
- func (om *Meta) GetNamespace() string
- func (om *Meta) GetObjectType() ObjectType
- func (om *Meta) GetUpdateTime() time.Time
- func (om *Meta) SetClusterID(cid string)
- func (om *Meta) SetCreateTime(t time.Time)
- func (om *Meta) SetName(n string)
- func (om *Meta) SetNamespace(ns string)
- func (om *Meta) SetObjectType(t ObjectType)
- func (om *Meta) SetUpdateTime(t time.Time)
- type ObjectKey
- type ObjectType
- type RawObject
- type StorageDynamic
- type StorageObjectDefinition
- type StorageObjectDefinitionSpec
- type ValueSelector
Constants ¶
const ( // TagResourceType tag for resource type TagResourceType = "resourceType" // TagResourceName tag for resource name TagResourceName = "resourceName" // TagNamespace tag for namespace TagNamespace = "namespace" // TagClusterID tag for cluster id TagClusterID = "clusterId" // TagCreateTime tag for create time TagCreateTime = "createTime" // TagUpdateTime tag for update time TagUpdateTime = "updateTime" )
const (
// ObjectTypeStorageDynamic type name for StorageDynamic
ObjectTypeStorageDynamic = "StorageDynamic"
)
const (
// ObjectTypeStorageObjectDefinition type name for StorageObjectDefinition
ObjectTypeStorageObjectDefinition = "StorageObjectDefinition"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterNamespacedName ¶
ClusterNamespacedName comprise a resource name
type Field ¶
type Field struct { Name string `json:"name" bson:"name"` Type FieldType `json:"type" bson:"type"` MaxBytes int64 `json:"maxBytes" bson:"maxBytes"` }
Field field
type FieldIndex ¶
type FieldIndex struct { Keys []string `json:"keys" bson:"keys"` Name string `json:"name" bson:"name"` Unique bool `json:"unique" bson:"unique"` }
FieldIndex field index
type Meta ¶
type Meta struct { Type ObjectType `json:"resourceType" bson:"resourceType"` Name string `json:"resourceName" bson:"resourceName"` Namespace string `json:"namespace" bson:"namespace"` ClusterID string `json:"clusterId" bson:"clusterId"` CreateTime time.Time `json:"createTime" bson:"createTime"` UpdateTime time.Time `json:"updateTime" bson:"updateTime"` }
Meta metadata for object
func (*Meta) GetCreateTime ¶
GetCreateTime get create time
func (*Meta) GetObjectType ¶
func (om *Meta) GetObjectType() ObjectType
GetObjectType get object type
func (*Meta) GetUpdateTime ¶
GetUpdateTime get update time
func (*Meta) SetCreateTime ¶
SetCreateTime set create time
func (*Meta) SetObjectType ¶
func (om *Meta) SetObjectType(t ObjectType)
SetObjectType set object type
func (*Meta) SetUpdateTime ¶
SetUpdateTime set update time
type RawObject ¶
type RawObject struct { Meta `json:",inline" bson:",inline"` Data map[string]interface{} `json:"data" bson:"data"` }
RawObject store object
type StorageDynamic ¶
type StorageDynamic struct { Meta `json:",inline" bson:",inline"` Data map[string]interface{} `json:"data" bson:"data"` }
StorageDynamic dynamic object for storage
type StorageObjectDefinition ¶
type StorageObjectDefinition struct { Meta `json:",inline" bson:",inline"` Data StorageObjectDefinitionSpec `json:"data" bson:"data"` }
StorageObjectDefinition object definition for storage
func NewStorageObjectDefinition ¶
func NewStorageObjectDefinition() *StorageObjectDefinition
NewStorageObjectDefinition create storage object definition
func (*StorageObjectDefinition) GetData ¶
func (sod *StorageObjectDefinition) GetData() map[string]interface{}
GetData get data
func (*StorageObjectDefinition) SetData ¶
func (sod *StorageObjectDefinition) SetData(data map[string]interface{}) error
SetData set data
type StorageObjectDefinitionSpec ¶
type StorageObjectDefinitionSpec struct { ObjectType string `json:"objectType" bson:"objectType"` Fields []Field `json:"fields" bson:"fields"` Indexes []FieldIndex `json:"indexes" bson:"indexes"` }
StorageObjectDefinitionSpec spec of StorageObjectDefinition
type ValueSelector ¶
type ValueSelector struct {
Pairs map[string]interface{}
}
ValueSelector selector for searching objects with certain value in their path
func NewValueSelector ¶
func NewValueSelector() *ValueSelector
NewValueSelector create value selector
func (*ValueSelector) Get ¶
func (vs *ValueSelector) Get(path string) (interface{}, bool)
Get get selector value
func (*ValueSelector) GetPairs ¶
func (vs *ValueSelector) GetPairs() map[string]interface{}
GetPairs return map[string]interface{}
func (*ValueSelector) Set ¶
func (vs *ValueSelector) Set(path string, value interface{}) error
Set set selector value pairs