Documentation
¶
Index ¶
- Variables
- type App
- type Command
- func (*Command) Descriptor() ([]byte, []int)deprecated
- func (x *Command) GetBoolVal() bool
- func (x *Command) GetId() string
- func (x *Command) GetItems() []*ListItem
- func (x *Command) GetName() string
- func (x *Command) GetNumVal() float64
- func (x *Command) GetOp() string
- func (x *Command) GetRawVal() []byte
- func (x *Command) GetStrVal() string
- func (x *Command) GetVal() isCommand_Val
- func (*Command) ProtoMessage()
- func (x *Command) ProtoReflect() protoreflect.Message
- func (x *Command) Reset()
- func (x *Command) String() string
- type Command_BoolVal
- type Command_NumVal
- type Command_RawVal
- type Command_StrVal
- type Component
- type Envelope
- func (*Envelope) Descriptor() ([]byte, []int)deprecated
- func (x *Envelope) GetArgs() []float64
- func (x *Envelope) GetMsg() []byte
- func (x *Envelope) GetValue() []byte
- func (*Envelope) ProtoMessage()
- func (x *Envelope) ProtoReflect() protoreflect.Message
- func (x *Envelope) Reset()
- func (x *Envelope) String() string
- type EventCommand
- func (*EventCommand) Descriptor() ([]byte, []int)deprecated
- func (x *EventCommand) GetId() string
- func (x *EventCommand) GetKey() string
- func (x *EventCommand) GetMsg() []byte
- func (x *EventCommand) GetOn() string
- func (*EventCommand) ProtoMessage()
- func (x *EventCommand) ProtoReflect() protoreflect.Message
- func (x *EventCommand) Reset()
- func (x *EventCommand) String() string
- type ListItem
- func (*ListItem) Descriptor() ([]byte, []int)deprecated
- func (x *ListItem) GetCmds() []*Command
- func (x *ListItem) GetEvts() []*EventCommand
- func (x *ListItem) GetHtml() string
- func (*ListItem) ProtoMessage()
- func (x *ListItem) ProtoReflect() protoreflect.Message
- func (x *ListItem) Reset()
- func (x *ListItem) String() string
- type ServerMessage
- func (*ServerMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ServerMessage) GetCommands() []*Command
- func (x *ServerMessage) GetEvents() []*EventCommand
- func (x *ServerMessage) GetType() string
- func (*ServerMessage) ProtoMessage()
- func (x *ServerMessage) ProtoReflect() protoreflect.Message
- func (x *ServerMessage) Reset()
- func (x *ServerMessage) String() string
- type WSMessage
- func (*WSMessage) Descriptor() ([]byte, []int)deprecated
- func (x *WSMessage) GetArgs() [][]byte
- func (x *WSMessage) GetField() string
- func (x *WSMessage) GetMethod() string
- func (x *WSMessage) GetScope() string
- func (x *WSMessage) GetType() string
- func (x *WSMessage) GetValue() []byte
- func (*WSMessage) ProtoMessage()
- func (x *WSMessage) ProtoReflect() protoreflect.Message
- func (x *WSMessage) Reset()
- func (x *WSMessage) String() string
Constants ¶
This section is empty.
Variables ¶
var File_protocol_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Port int // 0 = random available port
Host string // default "localhost"; set to "0.0.0.0" for network access
NoAuth bool // disable token auth (default false = auth enabled)
Token string // fixed auth token; empty = generate random token
NoBrowser bool // don't open browser on start
Quiet bool // suppress startup output
// contains filtered or unexported fields
}
App is the main godom application.
func (*App) Component ¶
Component registers a stateful component struct for a custom element tag. The tag must contain a hyphen (e.g., "todo-item"). The comp argument must be a pointer to a struct that embeds godom.Component.
func (*App) Mount ¶
Mount registers a component struct with an embedded filesystem containing HTML templates.
type Command ¶
type Command struct {
Op string `protobuf:"bytes,1,opt,name=op,proto3" json:"op,omitempty"` // "text","value","checked","display","class","attr","plugin","list","list-append","list-truncate","re-event"
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // data-gid of target element
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // class name (for "class" op), attr name, plugin name
// Types that are valid to be assigned to Val:
//
// *Command_StrVal
// *Command_BoolVal
// *Command_NumVal
// *Command_RawVal
Val isCommand_Val `protobuf_oneof:"val"`
Items []*ListItem `protobuf:"bytes,8,rep,name=items,proto3" json:"items,omitempty"` // for "list" and "list-append" ops
// contains filtered or unexported fields
}
Command is a single DOM operation.
func (*Command) Descriptor
deprecated
func (*Command) GetBoolVal ¶
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type Command_BoolVal ¶
type Command_BoolVal struct {
BoolVal bool `protobuf:"varint,5,opt,name=bool_val,json=boolVal,proto3,oneof"`
}
type Command_NumVal ¶
type Command_NumVal struct {
NumVal float64 `protobuf:"fixed64,6,opt,name=num_val,json=numVal,proto3,oneof"`
}
type Command_RawVal ¶
type Command_RawVal struct {
RawVal []byte `protobuf:"bytes,7,opt,name=raw_val,json=rawVal,proto3,oneof"` // JSON bytes for plugin data, re-event, etc.
}
type Command_StrVal ¶
type Command_StrVal struct {
StrVal string `protobuf:"bytes,4,opt,name=str_val,json=strVal,proto3,oneof"`
}
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component is embedded in user structs to make them godom components.
type Envelope ¶
type Envelope struct {
Args []float64 `protobuf:"fixed64,1,rep,packed,name=args,proto3" json:"args,omitempty"` // browser-side args (mouse x/y, wheel deltaY)
Msg []byte `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // pre-built WSMessage bytes from Go
Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // input value for bind events (JSON-encoded)
// contains filtered or unexported fields
}
Envelope is what the bridge sends to Go on every event. The bridge never opens msg — it forwards it untouched. args carries browser-side data (mouse coords, wheel delta).
func (*Envelope) Descriptor
deprecated
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
func (*Envelope) ProtoReflect ¶
func (x *Envelope) ProtoReflect() protoreflect.Message
type EventCommand ¶
type EventCommand struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // data-gid
On string `protobuf:"bytes,2,opt,name=on,proto3" json:"on,omitempty"` // "click","keydown","mousedown","mousemove","mouseup","wheel","input"
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // key filter for keydown
Msg []byte `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"` // pre-built Envelope.msg bytes — bridge sends back untouched
// contains filtered or unexported fields
}
EventCommand describes an event listener the bridge should register.
func (*EventCommand) Descriptor
deprecated
func (*EventCommand) Descriptor() ([]byte, []int)
Deprecated: Use EventCommand.ProtoReflect.Descriptor instead.
func (*EventCommand) GetId ¶
func (x *EventCommand) GetId() string
func (*EventCommand) GetKey ¶
func (x *EventCommand) GetKey() string
func (*EventCommand) GetMsg ¶
func (x *EventCommand) GetMsg() []byte
func (*EventCommand) GetOn ¶
func (x *EventCommand) GetOn() string
func (*EventCommand) ProtoMessage ¶
func (*EventCommand) ProtoMessage()
func (*EventCommand) ProtoReflect ¶
func (x *EventCommand) ProtoReflect() protoreflect.Message
func (*EventCommand) Reset ¶
func (x *EventCommand) Reset()
func (*EventCommand) String ¶
func (x *EventCommand) String() string
type ListItem ¶
type ListItem struct {
Html string `protobuf:"bytes,1,opt,name=html,proto3" json:"html,omitempty"`
Cmds []*Command `protobuf:"bytes,2,rep,name=cmds,proto3" json:"cmds,omitempty"`
Evts []*EventCommand `protobuf:"bytes,3,rep,name=evts,proto3" json:"evts,omitempty"`
// contains filtered or unexported fields
}
ListItem is a single item in a g-for list render.
func (*ListItem) Descriptor
deprecated
func (*ListItem) GetEvts ¶
func (x *ListItem) GetEvts() []*EventCommand
func (*ListItem) ProtoMessage ¶
func (*ListItem) ProtoMessage()
func (*ListItem) ProtoReflect ¶
func (x *ListItem) ProtoReflect() protoreflect.Message
type ServerMessage ¶
type ServerMessage struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // "init" or "update"
Commands []*Command `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"`
Events []*EventCommand `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"`
// contains filtered or unexported fields
}
ServerMessage is the top-level message sent from Go to the browser.
func (*ServerMessage) Descriptor
deprecated
func (*ServerMessage) Descriptor() ([]byte, []int)
Deprecated: Use ServerMessage.ProtoReflect.Descriptor instead.
func (*ServerMessage) GetCommands ¶
func (x *ServerMessage) GetCommands() []*Command
func (*ServerMessage) GetEvents ¶
func (x *ServerMessage) GetEvents() []*EventCommand
func (*ServerMessage) GetType ¶
func (x *ServerMessage) GetType() string
func (*ServerMessage) ProtoMessage ¶
func (*ServerMessage) ProtoMessage()
func (*ServerMessage) ProtoReflect ¶
func (x *ServerMessage) ProtoReflect() protoreflect.Message
func (*ServerMessage) Reset ¶
func (x *ServerMessage) Reset()
func (*ServerMessage) String ¶
func (x *ServerMessage) String() string
type WSMessage ¶
type WSMessage struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // "call" or "bind"
Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
Args [][]byte `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` // pre-resolved args, each JSON-encoded
Field string `protobuf:"bytes,4,opt,name=field,proto3" json:"field,omitempty"` // field name (for bind)
Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` // new value (for bind, added by bridge)
Scope string `protobuf:"bytes,6,opt,name=scope,proto3" json:"scope,omitempty"` // "forGID:idx" for child components
// contains filtered or unexported fields
}
WSMessage is the inner message pre-built by Go at render time. Serialized into EventCommand.msg and Envelope.msg.
func (*WSMessage) Descriptor
deprecated
func (*WSMessage) ProtoMessage ¶
func (*WSMessage) ProtoMessage()
func (*WSMessage) ProtoReflect ¶
func (x *WSMessage) ProtoReflect() protoreflect.Message
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic-form-builder
command
|
|
|
charts-without-plugin
command
|
|
|
clock
command
|
|
|
counter
command
|
|
|
drag-demo
command
|
|
|
drag-tiles
command
|
|
|
progress-bar
command
|
|
|
solar-system
command
|
|
|
stock-ticker
command
|
|
|
todolist
command
|
|
|
todolist-stateful
command
|
|
|
plugins
|
|
|
chartjs
Package chartjs provides a godom plugin for Chart.js integration.
|
Package chartjs provides a godom plugin for Chart.js integration. |



