Documentation
¶
Overview ¶
Package moolticute provides a client to interact with a moolticute daemon
Index ¶
Constants ¶
View Source
const (
DAEMON_DEFAULT_URL = "ws://localhost:30035"
)
Variables ¶
View Source
var ErrDeviceDisconnected = errors.New("device is disconnected")
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
NewClient makes a new websocket connection to the moolticute daemon If the url is empty, the MOOLTICUTE_DAEMON_DEFAULT_URL will be used
type Data ¶
type Data struct { Service string `json:"service,omitempty"` FallbackService string `json:"fallback_service,omitempty"` NodeData string `json:"node_data,omitempty"` Failed bool `json:"failed,omitempty"` ErrorMessage string `json:"error_message,omitempty"` Login string `json:"login,omitempty"` Password string `json:"password,omitempty"` Description string `json:"description,omitempty"` RequestId string `json:"request_id,omitempty"` ProgressTotal int `json:"progress_total,omitempty"` ProgressCurrent int `json:"progress_current,omitempty"` }
Data represents data sent and received from the daemon copied from https://github.com/raoulh/mc-cli
type Opt ¶
type Opt func(*opt)
func HandleOtherMsg ¶
func HandleOtherMsg(f func(msg string, data json.RawMessage) error) Opt
type ResponseError ¶
type ResponseError struct {
Message string
}
func (ResponseError) Error ¶
func (r ResponseError) Error() string
type StatusError ¶
type StatusError struct {
Status string // NoCardInserted, Locked, ...
}
func (StatusError) Error ¶
func (s StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.