Documentation
¶
Index ¶
- func StartUI(uiAddr, apiAddr string)
- type DataStore
- func (d *DataStore) Clear(name string)
- func (d *DataStore) ClearAll()
- func (d *DataStore) Delete(name, id string) bool
- func (d *DataStore) Get(name, id string) (map[string]any, bool)
- func (d *DataStore) List(name string) []map[string]any
- func (d *DataStore) Names() []string
- func (d *DataStore) Patch(name, id string, partial map[string]any) (map[string]any, bool)
- func (d *DataStore) Push(name string, item map[string]any) map[string]any
- func (d *DataStore) Put(name, id string, item map[string]any) bool
- func (d *DataStore) SetCollection(name string, items []map[string]any)
- type DynamicRoute
- type DynamicRouteStore
- type RequestEntry
- type RequestHistory
- type Server
- type StateStore
- type VarStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataStore ¶ added in v0.5.0
type DataStore struct {
// contains filtered or unexported fields
}
DataStore is a named-collection in-memory CRUD store. Each collection holds objects identified by a string "id" field.
func (*DataStore) ClearAll ¶ added in v0.5.0
func (d *DataStore) ClearAll()
ClearAll removes all collections.
func (*DataStore) Delete ¶ added in v0.5.0
Delete removes the item with the given id. Returns true if found and removed.
func (*DataStore) Get ¶ added in v0.5.0
Get returns the item with the given id from the named collection.
func (*DataStore) List ¶ added in v0.5.0
List returns a shallow copy of all items in the named collection.
func (*DataStore) Names ¶ added in v0.5.0
Names returns the names of all collections that have been written to.
func (*DataStore) Patch ¶ added in v0.5.0
Patch merges partial fields into the item with the given id. The "id" field is protected and cannot be overwritten. Returns the updated item and true, or nil and false if not found.
func (*DataStore) Push ¶ added in v0.5.0
Push appends item to the named collection after assigning a UUID "id". Returns the stored item (with id set).
type DynamicRoute ¶ added in v0.4.0
DynamicRoute is a route added at runtime via the introspection API.
type DynamicRouteStore ¶ added in v0.4.0
type DynamicRouteStore struct {
// contains filtered or unexported fields
}
func (*DynamicRouteStore) Add ¶ added in v0.4.0
func (d *DynamicRouteStore) Add(route config.Route) string
func (*DynamicRouteStore) All ¶ added in v0.4.0
func (d *DynamicRouteStore) All() []DynamicRoute
func (*DynamicRouteStore) Clear ¶ added in v0.4.0
func (d *DynamicRouteStore) Clear()
func (*DynamicRouteStore) Remove ¶ added in v0.4.0
func (d *DynamicRouteStore) Remove(id string) bool
type RequestEntry ¶ added in v0.4.0
type RequestHistory ¶ added in v0.4.0
type RequestHistory struct {
// contains filtered or unexported fields
}
type StateStore ¶ added in v0.4.0
type StateStore struct {
// contains filtered or unexported fields
}
func (*StateStore) Get ¶ added in v0.4.0
func (s *StateStore) Get() string
func (*StateStore) Set ¶ added in v0.4.0
func (s *StateStore) Set(v string)