Documentation ¶
Index ¶
Constants ¶
View Source
const (
TypeRequestCommand = "cmd"
)
View Source
const (
TypeResponseLog = "log"
)
View Source
const (
TypeResponseResult = "result"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRequest ¶
type CommandRequest struct { // Name is the command name of this [proto.CommandRequest] in kebab-case, // like "config" or "dry-run". Name string `json:"name" mapstructure:"name"` // Flags is a set of flags, which use kebab-case for keys // and builtin types for values. Flags map[string]any `json:"flags" mapstructure:"flags"` }
CommandRequest is a request of command. Use kebab-case for command name and flags.
type Request ¶
type Request struct { Type string `json:"type" mapstructure:"type"` Data any `json:"data" mapstructure:"data"` }
func NewRequest ¶
type Response ¶
type Response struct { Type string `json:"type" mapstructure:"type"` Data any `json:"data" mapstructure:"data"` }
func NewErrorResult ¶
func NewResponse ¶
func NewSuccessResult ¶
Click to show internal directories.
Click to hide internal directories.