Documentation ¶
Index ¶
- Constants
- 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 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
Constants ¶
View Source
const ( MetaKey_View = "view" MetaKey_Controller = "controller" MetaKey_Title = "title" MetaKey_File = "file" MetaKey_Url = "url" 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_Frame = "frame" MetaKey_FrameClear = "frame:*" MetaKey_FrameBorderColor = "frame:bordercolor" MetaKey_FrameBorderColor_Focused = "frame:bordercolor:focused" MetaKey_Cmd = "cmd" MetaKey_CmdClear = "cmd:*" MetaKey_CmdInteractive = "cmd:interactive" MetaKey_CmdLogin = "cmd:login" MetaKey_CmdRunOnStart = "cmd:runonstart" MetaKey_CmdClearOnStart = "cmd:clearonstart" MetaKey_CmdClearOnRestart = "cmd:clearonrestart" MetaKey_CmdEnv = "cmd:env" MetaKey_CmdCwd = "cmd:cwd" MetaKey_CmdNoWsh = "cmd:nowsh" MetaKey_GraphClear = "graph:*" MetaKey_GraphNumPoints = "graph:numpoints" MetaKey_GraphMetrics = "graph:metrics" MetaKey_Bg = "bg" MetaKey_BgClear = "bg:*" MetaKey_BgOpacity = "bg:opacity" MetaKey_BgBlendMode = "bg:blendmode" 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_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" )
View Source
const Entity_Any = "any"
Variables ¶
This section is empty.
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 Block ¶
type Block struct { OID string `json:"oid"` Version int `json:"version"` BlockDef *BlockDef `json:"blockdef"` RuntimeOpts *RuntimeOpts `json:"runtimeopts,omitempty"` Stickers []*StickerType `json:"stickers,omitempty"` Meta MetaMapType `json:"meta"` }
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"` Title string `json:"title,omitempty"` File string `json:"file,omitempty"` Url string `json:"url,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"` Frame bool `json:"frame,omitempty"` FrameClear bool `json:"frame:*,omitempty"` FrameBorderColor string `json:"frame:bordercolor,omitempty"` FrameBorderColor_Focused string `json:"frame:bordercolor:focused,omitempty"` Cmd string `json:"cmd,omitempty"` CmdClear bool `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"` CmdClearOnRestart bool `json:"cmd:clearonrestart,omitempty"` CmdEnv map[string]string `json:"cmd:env,omitempty"` CmdCwd string `json:"cmd:cwd,omitempty"` CmdNoWsh bool `json:"cmd:nowsh,omitempty"` GraphClear bool `json:"graph:*,omitempty"` GraphNumPoints int `json:"graph:numpoints,omitempty"` GraphMetrics []string `json:"graph:metrics,omitempty"` // for tabs Bg string `json:"bg,omitempty"` BgClear bool `json:"bg:*,omitempty"` BgOpacity float64 `json:"bg:opacity,omitempty"` BgBlendMode string `json:"bg:blendmode,omitempty"` 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 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 (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"` ActiveTabId string `json:"activetabid"` Pos Point `json:"pos"` WinSize WinSize `json:"winsize"` LastFocusTs int64 `json:"lastfocusts"` Meta MetaMapType `json:"meta"` }
stores the ui-context of the window workspaceid, active tab, active block within each tab, window size, etc.
Click to show internal directories.
Click to hide internal directories.