Documentation ¶
Overview ¶
Package customdata provides a way to store custom data in Easegress cluster.
Index ¶
- type Data
- type Kind
- type KindWithLen
- type Store
- func (s *Store) BatchUpdateData(kind string, del []string, update []Data) error
- func (s *Store) DataLen(kind string) (int, error)
- func (s *Store) DeleteAllData(kind string) error
- func (s *Store) DeleteAllKinds() 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 `json:"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 `json:"idField" jsonschema:"omitempty"` // JSONSchema is JSON schema to validate a custom data of this kind JSONSchema dynamicobject.DynamicObject `json:"jsonSchema" jsonschema:"omitempty"` }
Kind defines the spec of a custom data kind
func (*Kind) GetIDField ¶
GetIDField returns the ID field name of the custom data kind
type KindWithLen ¶
KindWithLen defines the spec of a custom data kind with length
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) DeleteAllKinds ¶
DeleteAllKind deletes all custom data kinds with all data
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.