Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionCommand ¶
type ConnectionReply ¶
type ConnectionReply struct {
Current struct {
State string `json:"state"`
Port string `json:"port"`
Baudrate int `json:"baudrate"`
PrinterProfile string `json:"printerProfile"`
} `json:"current"`
Options struct {
Ports []string `json:"ports"`
Baudrates []int `json:"baudrates"`
PrinterProfiles []struct {
Name string `json:"name"`
ID string `json:"id"`
} `json:"printerProfiles"`
PortPreference string `json:"portPreference"`
BaudratePreference int `json:"baudratePreference"`
PrinterProfilePreference string `json:"printerProfilePreference"`
Autoconnect bool `json:"autoconnect"`
} `json:"options"`
}
type FileStorage ¶
type GcodeCommandRequest ¶
type GcodeCommandRequest struct {
Command string `json:"command"`
}
type WebApi ¶
type WebApi struct {
Version string
// contains filtered or unexported fields
}
WebApi is the macro structure of Print2Go, implements and manages the server and web API, handling storage, print tasks, serial port and camera.
func New ¶
func New(listenAddr string, store FileStorage, motdFile string, openSerial func(serial.SerialConfig) (hwserial.Port, error), shutdown func()) *WebApi
New creates a new WebApi instance. Starts a new task and returns the instance.
func (*WebApi) SetVersion ¶
SetVersion sets the current version of Print2Go
Click to show internal directories.
Click to hide internal directories.