Documentation ¶
Index ¶
- Constants
- Variables
- func AllWaveObjTypes() []reflect.Type
- func ContextAddUpdate(ctx context.Context, update WaveObjUpdate)
- func ContextGetUpdates(ctx context.Context) map[ORef]WaveObjUpdate
- func ContextPrintUpdates(ctx context.Context)
- func ContextUpdatesBeginTx(ctx context.Context) context.Context
- func ContextUpdatesCommitTx(ctx context.Context)
- func ContextUpdatesRollbackTx(ctx context.Context)
- func ContextWithUpdates(ctx context.Context) context.Context
- func FromJsonGen[T WaveObj](data []byte) (T, error)
- func GetOID(waveObj WaveObj) string
- func GetVersion(waveObj WaveObj) int
- func RegisterType(rtype reflect.Type)
- func SetMeta(waveObj WaveObj, meta map[string]any)
- func SetOID(waveObj WaveObj, oid string)
- func SetVersion(waveObj WaveObj, version int)
- func ToJson(w WaveObj) ([]byte, error)
- func ToJsonMap(w WaveObj) (map[string]any, error)
- type ActiveTabUpdate
- type Block
- type BlockDef
- type Client
- type FileDef
- type LayoutActionData
- type LayoutState
- type LeafOrderEntry
- type MetaDataDecl
- type MetaMapType
- func (m MetaMapType) GetArray(key string) []any
- func (m MetaMapType) GetBool(key string, def bool) bool
- func (m MetaMapType) GetFloat(key string, def float64) float64
- func (m MetaMapType) GetInt(key string, def int) int
- func (m MetaMapType) GetMap(key string) MetaMapType
- func (m MetaMapType) GetString(key string, def string) string
- func (m MetaMapType) GetStringArray(key string) []string
- func (m MetaMapType) GetStringList(key string) []string
- type MetaPresetDecl
- type MetaTSType
- type ORef
- type Point
- type RuntimeOpts
- type StickerClickOptsType
- type StickerDisplayOptsType
- type StickerType
- type Tab
- type TermSize
- type UIContext
- type UpdatesRtnType
- type WaveObj
- type WaveObjUpdate
- type WinSize
- type Window
- type Workspace
- type WorkspaceList
- type WorkspaceListEntry
Constants ¶
View Source
const ( MetaKey_View = "view" MetaKey_Controller = "controller" MetaKey_File = "file" MetaKey_Url = "url" MetaKey_PinnedUrl = "pinnedurl" MetaKey_Connection = "connection" MetaKey_Edit = "edit" MetaKey_History = "history" MetaKey_HistoryForward = "history:forward" MetaKey_DisplayName = "display:name" MetaKey_DisplayOrder = "display:order" MetaKey_Icon = "icon" MetaKey_IconColor = "icon:color" MetaKey_FrameClear = "frame:*" MetaKey_Frame = "frame" MetaKey_FrameBorderColor = "frame:bordercolor" MetaKey_FrameActiveBorderColor = "frame:activebordercolor" MetaKey_FrameTitle = "frame:title" MetaKey_FrameIcon = "frame:icon" MetaKey_FrameText = "frame:text" MetaKey_CmdClear = "cmd:*" MetaKey_Cmd = "cmd" MetaKey_CmdInteractive = "cmd:interactive" MetaKey_CmdLogin = "cmd:login" MetaKey_CmdRunOnStart = "cmd:runonstart" MetaKey_CmdClearOnStart = "cmd:clearonstart" MetaKey_CmdRunOnce = "cmd:runonce" MetaKey_CmdCloseOnExit = "cmd:closeonexit" MetaKey_CmdCloseOnExitForce = "cmd:closeonexitforce" MetaKey_CmdCloseOnExitDelay = "cmd:closeonexitdelay" MetaKey_CmdEnv = "cmd:env" MetaKey_CmdCwd = "cmd:cwd" MetaKey_CmdNoWsh = "cmd:nowsh" MetaKey_CmdArgs = "cmd:args" MetaKey_CmdShell = "cmd:shell" MetaKey_AiClear = "ai:*" MetaKey_AiPresetKey = "ai:preset" MetaKey_AiApiType = "ai:apitype" MetaKey_AiBaseURL = "ai:baseurl" MetaKey_AiApiToken = "ai:apitoken" MetaKey_AiName = "ai:name" MetaKey_AiModel = "ai:model" MetaKey_AiOrgID = "ai:orgid" MetaKey_AIApiVersion = "ai:apiversion" MetaKey_AiMaxTokens = "ai:maxtokens" MetaKey_AiTimeoutMs = "ai:timeoutms" MetaKey_EditorClear = "editor:*" MetaKey_EditorMinimapEnabled = "editor:minimapenabled" MetaKey_EditorStickyScrollEnabled = "editor:stickyscrollenabled" MetaKey_EditorWordWrap = "editor:wordwrap" MetaKey_GraphClear = "graph:*" MetaKey_GraphNumPoints = "graph:numpoints" MetaKey_GraphMetrics = "graph:metrics" MetaKey_SysinfoType = "sysinfo:type" MetaKey_BgClear = "bg:*" MetaKey_Bg = "bg" MetaKey_BgOpacity = "bg:opacity" MetaKey_BgBlendMode = "bg:blendmode" MetaKey_BgBorderColor = "bg:bordercolor" MetaKey_BgActiveBorderColor = "bg:activebordercolor" MetaKey_TermClear = "term:*" MetaKey_TermFontSize = "term:fontsize" MetaKey_TermFontFamily = "term:fontfamily" MetaKey_TermMode = "term:mode" MetaKey_TermTheme = "term:theme" MetaKey_TermLocalShellPath = "term:localshellpath" MetaKey_TermLocalShellOpts = "term:localshellopts" MetaKey_TermScrollback = "term:scrollback" MetaKey_TermVDomSubBlockId = "term:vdomblockid" MetaKey_TermVDomToolbarBlockId = "term:vdomtoolbarblockid" MetaKey_TermTransparency = "term:transparency" MetaKey_WebZoom = "web:zoom" MetaKey_MarkdownFontSize = "markdown:fontsize" MetaKey_MarkdownFixedFontSize = "markdown:fixedfontsize" MetaKey_VDomClear = "vdom:*" MetaKey_VDomInitialized = "vdom:initialized" MetaKey_VDomCorrelationId = "vdom:correlationid" MetaKey_VDomRoute = "vdom:route" MetaKey_VDomPersist = "vdom:persist" MetaKey_Count = "count" )
View Source
const ( OTypeKeyName = "otype" OIDKeyName = "oid" VersionKeyName = "version" MetaKeyName = "meta" OIDGoFieldName = "OID" VersionGoFieldName = "Version" MetaGoFieldName = "Meta" )
View Source
const ( UpdateType_Update = "update" UpdateType_Delete = "delete" )
View Source
const ( OType_Client = "client" OType_Window = "window" OType_Workspace = "workspace" OType_Tab = "tab" OType_LayoutState = "layout" OType_Block = "block" OType_Temp = "temp" )
View Source
const Entity_Any = "any"
Variables ¶
View Source
var ValidOTypes = map[string]bool{ OType_Client: true, OType_Window: true, OType_Workspace: true, OType_Tab: true, OType_LayoutState: true, OType_Block: true, OType_Temp: true, }
Functions ¶
func AllWaveObjTypes ¶
func ContextAddUpdate ¶
func ContextAddUpdate(ctx context.Context, update WaveObjUpdate)
func ContextGetUpdates ¶
func ContextGetUpdates(ctx context.Context) map[ORef]WaveObjUpdate
func ContextPrintUpdates ¶
func ContextUpdatesCommitTx ¶
func FromJsonGen ¶
func GetVersion ¶
func RegisterType ¶
func SetVersion ¶
Types ¶
type ActiveTabUpdate ¶ added in v0.10.0
type Block ¶
type Block struct { OID string `json:"oid"` ParentORef string `json:"parentoref,omitempty"` Version int `json:"version"` RuntimeOpts *RuntimeOpts `json:"runtimeopts,omitempty"` Stickers []*StickerType `json:"stickers,omitempty"` Meta MetaMapType `json:"meta"` SubBlockIds []string `json:"subblockids,omitempty"` }
type BlockDef ¶
type BlockDef struct { Files map[string]*FileDef `json:"files,omitempty"` Meta MetaMapType `json:"meta,omitempty"` }
type Client ¶
type LayoutActionData ¶
type LayoutState ¶
type LayoutState struct { OID string `json:"oid"` Version int `json:"version"` RootNode any `json:"rootnode,omitempty"` MagnifiedNodeId string `json:"magnifiednodeid,omitempty"` FocusedNodeId string `json:"focusednodeid,omitempty"` LeafOrder *[]LeafOrderEntry `json:"leaforder,omitempty"` PendingBackendActions *[]LayoutActionData `json:"pendingbackendactions,omitempty"` Meta MetaMapType `json:"meta,omitempty"` }
func (*LayoutState) GetOType ¶
func (*LayoutState) GetOType() string
type LeafOrderEntry ¶
type MetaDataDecl ¶
type MetaDataDecl struct { Key string `json:"key"` Desc string `json:"desc,omitempty"` Type string `json:"type"` // string, int, float, bool, array, object Default any `json:"default,omitempty"` StrOptions []string `json:"stroptions,omitempty"` NumRange []*int `json:"numrange,omitempty"` // inclusive, null means no limit Entity []string `json:"entity"` // what entities this applies to, e.g. "block", "tab", "any", etc. Special []string `json:"special,omitempty"` // special handling. things that need to happen if this gets updated }
type MetaMapType ¶
func GetMeta ¶
func GetMeta(waveObj WaveObj) MetaMapType
func MergeMeta ¶
func MergeMeta(meta MetaMapType, metaUpdate MetaMapType, mergeSpecial bool) MetaMapType
returns a clean copy of meta with mergeMeta merged in if mergeSpecial is false, then special keys will not be merged (like display:*)
func (MetaMapType) GetArray ¶
func (m MetaMapType) GetArray(key string) []any
func (MetaMapType) GetMap ¶
func (m MetaMapType) GetMap(key string) MetaMapType
func (MetaMapType) GetStringArray ¶
func (m MetaMapType) GetStringArray(key string) []string
func (MetaMapType) GetStringList ¶ added in v0.8.8
func (m MetaMapType) GetStringList(key string) []string
type MetaPresetDecl ¶
type MetaTSType ¶
type MetaTSType struct { // shared View string `json:"view,omitempty"` Controller string `json:"controller,omitempty"` File string `json:"file,omitempty"` Url string `json:"url,omitempty"` PinnedUrl string `json:"pinnedurl,omitempty"` Connection string `json:"connection,omitempty"` Edit bool `json:"edit,omitempty"` History []string `json:"history,omitempty"` HistoryForward []string `json:"history:forward,omitempty"` DisplayName string `json:"display:name,omitempty"` DisplayOrder float64 `json:"display:order,omitempty"` Icon string `json:"icon,omitempty"` IconColor string `json:"icon:color,omitempty"` FrameClear bool `json:"frame:*,omitempty"` Frame bool `json:"frame,omitempty"` FrameBorderColor string `json:"frame:bordercolor,omitempty"` FrameActiveBorderColor string `json:"frame:activebordercolor,omitempty"` FrameTitle string `json:"frame:title,omitempty"` FrameIcon string `json:"frame:icon,omitempty"` FrameText string `json:"frame:text,omitempty"` CmdClear bool `json:"cmd:*,omitempty"` Cmd string `json:"cmd,omitempty"` CmdInteractive bool `json:"cmd:interactive,omitempty"` CmdLogin bool `json:"cmd:login,omitempty"` CmdRunOnStart bool `json:"cmd:runonstart,omitempty"` CmdClearOnStart bool `json:"cmd:clearonstart,omitempty"` CmdRunOnce bool `json:"cmd:runonce,omitempty"` CmdCloseOnExit bool `json:"cmd:closeonexit,omitempty"` CmdCloseOnExitForce bool `json:"cmd:closeonexitforce,omitempty"` CmdCloseOnExitDelay float64 `json:"cmd:closeonexitdelay,omitempty"` CmdEnv map[string]string `json:"cmd:env,omitempty"` CmdCwd string `json:"cmd:cwd,omitempty"` CmdNoWsh bool `json:"cmd:nowsh,omitempty"` CmdArgs []string `json:"cmd:args,omitempty"` // args for cmd (only if cmd:shell is false) CmdShell bool `json:"cmd:shell,omitempty"` // shell expansion for cmd+args (defaults to true) // AI options match settings AiClear bool `json:"ai:*,omitempty"` AiPresetKey string `json:"ai:preset,omitempty"` AiApiType string `json:"ai:apitype,omitempty"` AiBaseURL string `json:"ai:baseurl,omitempty"` AiApiToken string `json:"ai:apitoken,omitempty"` AiName string `json:"ai:name,omitempty"` AiModel string `json:"ai:model,omitempty"` AiOrgID string `json:"ai:orgid,omitempty"` AIApiVersion string `json:"ai:apiversion,omitempty"` AiMaxTokens float64 `json:"ai:maxtokens,omitempty"` AiTimeoutMs float64 `json:"ai:timeoutms,omitempty"` EditorClear bool `json:"editor:*,omitempty"` EditorMinimapEnabled bool `json:"editor:minimapenabled,omitempty"` EditorStickyScrollEnabled bool `json:"editor:stickyscrollenabled,omitempty"` EditorWordWrap bool `json:"editor:wordwrap,omitempty"` GraphClear bool `json:"graph:*,omitempty"` GraphNumPoints int `json:"graph:numpoints,omitempty"` GraphMetrics []string `json:"graph:metrics,omitempty"` SysinfoType string `json:"sysinfo:type,omitempty"` // for tabs BgClear bool `json:"bg:*,omitempty"` Bg string `json:"bg,omitempty"` BgOpacity float64 `json:"bg:opacity,omitempty"` BgBlendMode string `json:"bg:blendmode,omitempty"` BgBorderColor string `json:"bg:bordercolor,omitempty"` // frame:bordercolor BgActiveBorderColor string `json:"bg:activebordercolor,omitempty"` // frame:activebordercolor TermClear bool `json:"term:*,omitempty"` TermFontSize int `json:"term:fontsize,omitempty"` TermFontFamily string `json:"term:fontfamily,omitempty"` TermMode string `json:"term:mode,omitempty"` TermTheme string `json:"term:theme,omitempty"` TermLocalShellPath string `json:"term:localshellpath,omitempty"` // matches settings TermLocalShellOpts []string `json:"term:localshellopts,omitempty"` // matches settings TermScrollback *int `json:"term:scrollback,omitempty"` TermVDomSubBlockId string `json:"term:vdomblockid,omitempty"` TermVDomToolbarBlockId string `json:"term:vdomtoolbarblockid,omitempty"` TermTransparency *float64 `json:"term:transparency,omitempty"` // default 0.5 WebZoom float64 `json:"web:zoom,omitempty"` MarkdownFontSize float64 `json:"markdown:fontsize,omitempty"` MarkdownFixedFontSize float64 `json:"markdown:fixedfontsize,omitempty"` VDomClear bool `json:"vdom:*,omitempty"` VDomInitialized bool `json:"vdom:initialized,omitempty"` VDomCorrelationId string `json:"vdom:correlationid,omitempty"` VDomRoute string `json:"vdom:route,omitempty"` VDomPersist bool `json:"vdom:persist,omitempty"` Count int `json:"count,omitempty"` // temp for cpu plot. will remove later }
for typescript typing
type ORef ¶
type ORef struct { // special JSON marshalling to string OType string `json:"otype" mapstructure:"otype"` OID string `json:"oid" mapstructure:"oid"` }
func ORefFromWaveObj ¶
func ParseORefNoErr ¶ added in v0.9.0
func (ORef) MarshalJSON ¶
func (*ORef) UnmarshalJSON ¶
type RuntimeOpts ¶
type StickerClickOptsType ¶
type StickerDisplayOptsType ¶
type StickerType ¶
type StickerType struct { StickerType string `json:"stickertype"` Style map[string]any `json:"style"` ClickOpts *StickerClickOptsType `json:"clickopts,omitempty"` Display *StickerDisplayOptsType `json:"display"` }
type Tab ¶
type Tab struct { OID string `json:"oid"` Version int `json:"version"` Name string `json:"name"` LayoutState string `json:"layoutstate"` BlockIds []string `json:"blockids"` Meta MetaMapType `json:"meta"` }
func (*Tab) GetBlockORefs ¶
type UpdatesRtnType ¶
type UpdatesRtnType = []WaveObjUpdate
func ContextGetUpdatesRtn ¶
func ContextGetUpdatesRtn(ctx context.Context) UpdatesRtnType
type WaveObj ¶
type WaveObj interface {
GetOType() string // should not depend on object state (should work with nil value)
}
type WaveObjUpdate ¶
type WaveObjUpdate struct { UpdateType string `json:"updatetype"` OType string `json:"otype"` OID string `json:"oid"` Obj WaveObj `json:"obj,omitempty"` }
func ContextGetUpdate ¶
func ContextGetUpdate(ctx context.Context, oref ORef) *WaveObjUpdate
func MakeUpdate ¶
func MakeUpdate(obj WaveObj) WaveObjUpdate
func MakeUpdates ¶
func MakeUpdates(objs []WaveObj) []WaveObjUpdate
func (WaveObjUpdate) MarshalJSON ¶
func (update WaveObjUpdate) MarshalJSON() ([]byte, error)
func (*WaveObjUpdate) UnmarshalJSON ¶
func (update *WaveObjUpdate) UnmarshalJSON(data []byte) error
type Window ¶
type Window struct { OID string `json:"oid"` Version int `json:"version"` WorkspaceId string `json:"workspaceid"` IsNew bool `json:"isnew,omitempty"` // set when a window is created on the backend so the FE can size it properly. cleared on first resize Pos Point `json:"pos"` WinSize WinSize `json:"winsize"` LastFocusTs int64 `json:"lastfocusts"` Meta MetaMapType `json:"meta"` }
stores the ui-context of the window, points to a workspace containing the actual data being displayed in the window
type Workspace ¶
type Workspace struct { OID string `json:"oid"` Version int `json:"version"` Name string `json:"name,omitempty"` Icon string `json:"icon,omitempty"` Color string `json:"color,omitempty"` TabIds []string `json:"tabids"` PinnedTabIds []string `json:"pinnedtabids"` ActiveTabId string `json:"activetabid"` Meta MetaMapType `json:"meta"` }
type WorkspaceList ¶ added in v0.10.0
type WorkspaceList []*WorkspaceListEntry
type WorkspaceListEntry ¶ added in v0.10.0
Click to show internal directories.
Click to hide internal directories.