orgkit

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Card

func Card(r map[string]any) sdk.Node

Card is one exposure row (org.unit.exposed) as a widget.

func Cards

func Cards(c querier, child string, keep func(row map[string]any) bool) (*sdk.Node, error)

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 Children

func Children(c querier) ([]map[string]any, error)

Children are the units below as this unit's org sees them (org.unit.children).

func Each

func Each(c querier, source string) []map[string]any

Each is source (org.unit.kpis, org.unit.people, ...) of every reachable child, each row tagged with its unit.

func List

func List(c state, k Kind) ([]map[string]any, error)

List is kind's records, derived and sorted.

func Records

func Records(p *sdk.Plugin, k Kind)

Records registers kind's source and action on p.

func Rows

func Rows(f *sdk.Frame) []map[string]any

Rows are a frame's rows.

func Save

func Save(c state, user string, k Kind, a sdk.Args) (*sdk.Result, error)

Save creates, updates or deletes one record from a's fields.

Types

type Field

type Field struct {
	Name, Type, Description string
	Required, Computed      bool
	Options                 []string
	Default                 any
}

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
}

Kind is a record type: source <Plural> lists them, action <Name> creates, updates (id) or deletes (delete: true) one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL