Documentation
¶
Index ¶
- type Data
- type Kind
- type Store
- func (s *Store) BatchUpdateData(kind string, del []string, update []Data) error
- func (s *Store) DeleteAllData(kind string) error
- func (s *Store) DeleteData(kind string, id string) error
- func (s *Store) DeleteKind(name string) error
- func (s *Store) GetData(kind string, id string) (Data, error)
- func (s *Store) GetKind(name string) (*Kind, error)
- func (s *Store) ListData(kind string) ([]Data, error)
- func (s *Store) ListKinds() ([]*Kind, error)
- func (s *Store) PutData(kind string, data Data, update bool) (string, error)
- func (s *Store) PutKind(kind *Kind, update bool) error
- func (s *Store) Watch(ctx context.Context, kind string, onChange func([]Data)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind struct {
// Name is the name of the Kind
Name string `yaml:"name" jsonschema:"required"`
// IDField is a field name of custom data of this kind, this field is the ID
// of the data, that's unique among the same kind, the default value is 'name'.
IDField string `yaml:"idField" jsonschema:"omitempty"`
// JSONSchema is JSON schema to validate a custom data of this kind
JSONSchema dynamicobject.DynamicObject `yaml:"jsonSchema" jsonschema:"omitempty"`
}
Kind defines the spec of a custom data kind
type Store ¶
Store defines the storage for custom data
func (*Store) BatchUpdateData ¶
BatchUpdateData updates multiple custom data in a transaction
func (*Store) DeleteAllData ¶
DeleteAllData deletes all custom data of kind 'kind'
func (*Store) DeleteData ¶
DeleteData deletes a custom data
func (*Store) DeleteKind ¶
DeleteKind deletes a custom data kind
func (*Store) ListData ¶
ListData lists custom data of specified kind. if kind is empty, it returns custom data of all kinds.
Click to show internal directories.
Click to hide internal directories.