Documentation
¶
Overview ¶
Package orgkit is what the layer plugins (org-management, org-product, ...) share: records kept in the plugin's state, reading the units below through the unit's own org, and the exposure cards.
Index ¶
- func Card(r map[string]any) sdk.Node
- func Cards(c querier, child string, keep func(row map[string]any) bool) (*sdk.Node, error)
- func Children(c querier) ([]map[string]any, error)
- func Each(c querier, source string) []map[string]any
- func List(c state, k Kind) ([]map[string]any, error)
- func Num(v any) float64
- func Records(p *sdk.Plugin, k Kind)
- func Rows(f *sdk.Frame) []map[string]any
- func Save(c state, user string, k Kind, a sdk.Args) (*sdk.Result, error)
- func Str(v any) string
- func Table(rows []map[string]any, cols ...string) *sdk.Frame
- func Time(v any) time.Time
- type Field
- type Health
- type Kind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cards ¶
Cards renders what the units below expose to this one (child "*") or one child's, as a card each: a source's widget bound to org.unit.show, an action's form bound to org.unit.invoke. keep, when set, picks the exposures to show.
func Each ¶
Each is source (org.unit.kpis, org.unit.people, ...) of every reachable child, each row tagged with its unit.
func Num ¶ added in v1.10.0
Num reads a number from a row value the way records and frames carry it.
Types ¶
type Health ¶ added in v1.10.0
type Health struct {
Name string `json:"name"`
Title string `json:"title"`
Value float64 `json:"value"`
Measure string `json:"measure"`
Status string `json:"status"`
OK int `json:"ok"`
Warn int `json:"warn"`
Err int `json:"err"`
High int `json:"high"`
OpenRequests int `json:"open_requests"`
Note string `json:"note"`
}
Health is a scorecard row per unit below: KPIs on target as the value, coloured by the worst sign.
type Kind ¶
type Kind struct {
Name, Plural, Title string
Fields []Field
// Derive adds computed columns (declared as Computed fields) to a row before it is listed.
Derive func(row map[string]any)
// Sort is a field to order by; a leading - sorts descending. Left out, the latest updated first.
Sort string
// Private records are seen and changed only by the person who made them.
Private bool
// Saved runs after a create or update, with the saved row (a meeting sends its invite).
Saved func(c *sdk.Ctx, row map[string]any, res *sdk.Result) *sdk.Result
}
Kind is a record type: source <Plural> lists them, action <Name> creates, updates (id) or deletes (delete: true) one.