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) LastPersistError() error
- 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) ReplaceAll(collections map[string][]map[string]any)
- func (d *DataStore) ResetAll()
- func (d *DataStore) SetCollection(name string, items []map[string]any)
- func (d *DataStore) SetSeed(seed map[string][]map[string]any)
- type DynamicRoute
- type DynamicRouteStore
- type RequestEntry
- type RequestHistory
- type ScenarioStore
- type Server
- type StateStore
- type TimelineProgress
- type TimelineStore
- 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) LastPersistError ¶ added in v1.0.0
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).
func (*DataStore) Put ¶ added in v0.5.0
Put replaces the item with the given id (upsert — inserts if not found). Returns true if an existing item was replaced, false if inserted.
func (*DataStore) ReplaceAll ¶ added in v1.0.0
ReplaceAll replaces every collection with a shallow copy of collections.
func (*DataStore) ResetAll ¶ added in v1.0.0
func (d *DataStore) ResetAll()
ResetAll restores the configured seed collections.
func (*DataStore) SetCollection ¶ added in v0.5.0
SetCollection replaces the entire named collection.
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 ScenarioStore ¶ added in v1.0.0
type ScenarioStore struct {
// contains filtered or unexported fields
}
func (*ScenarioStore) Clear ¶ added in v1.0.0
func (s *ScenarioStore) Clear()
func (*ScenarioStore) Get ¶ added in v1.0.0
func (s *ScenarioStore) Get() string
func (*ScenarioStore) Set ¶ added in v1.0.0
func (s *ScenarioStore) Set(name string)
type Server ¶ added in v0.2.0
type Server struct {
// contains filtered or unexported fields
}
func NewWithStoreFile ¶ added in v1.0.0
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)
type TimelineProgress ¶ added in v1.0.0
type TimelineProgress struct {
Key string `json:"key"`
Method string `json:"method"`
Path string `json:"path"`
Source string `json:"source"`
Step int `json:"step"`
Total int `json:"total"`
Calls uint64 `json:"calls"`
Complete bool `json:"complete"`
Description string `json:"description,omitempty"`
}
type TimelineStore ¶ added in v1.0.0
type TimelineStore struct {
// contains filtered or unexported fields
}
func (*TimelineStore) Advance ¶ added in v1.0.0
func (t *TimelineStore) Advance(key, method, path, source string, total int) TimelineProgress
func (*TimelineStore) Clear ¶ added in v1.0.0
func (t *TimelineStore) Clear()
func (*TimelineStore) Reset ¶ added in v1.0.0
func (t *TimelineStore) Reset(key string)
func (*TimelineStore) Snapshot ¶ added in v1.0.0
func (t *TimelineStore) Snapshot(defs []TimelineProgress) []TimelineProgress