Documentation
¶
Index ¶
- Variables
- func AppendDataWithTimeToFile(data string) error
- func AppendStringToFile(data string, fileLabel string) error
- func AppendStringToFileDirect(data string, file *os.File) error
- func AppendToFile(data []byte, fileLabel string) error
- func AppendToFileDirect(data []byte, file *os.File) error
- func CreateFileWithTimestamp() error
- func OpenFile(*menu.CallbackData)
- func SerialInit(selectedPort string) (string, error)
- type Client
- type Hub
Constants ¶
This section is empty.
Variables ¶
View Source
var Addr = flag.String("addr", ":3007", "http service address")
View Source
var HUB = &Hub{}
View Source
var Port serial.Port
Functions ¶
func AppendStringToFile ¶ added in v1.1.0
func AppendStringToFileDirect ¶ added in v1.2.2
func AppendToFile ¶ added in v1.1.0
func CreateFileWithTimestamp ¶
func CreateFileWithTimestamp() error
func OpenFile ¶
func OpenFile(*menu.CallbackData)
func SerialInit ¶
Types ¶
type Client ¶
type Client struct { Hub *Hub // Buffered channel of outbound messages. Send chan []byte // contains filtered or unexported fields }
Client is a middleman between the websocket connection and the hub.
func (*Client) ReadPump ¶
func (c *Client) ReadPump()
readPump pumps messages from the websocket connection to the hub.
The application runs readPump in a per-connection goroutine. The application ensures that there is at most one reader on a connection by executing all reads from this goroutine.
func (*Client) WritePump ¶
func (c *Client) WritePump()
writePump pumps messages from the hub to the websocket connection.
A goroutine running writePump is started for each connection. The application ensures that there is at most one writer to a connection by executing all writes from this goroutine.
type Hub ¶
type Hub struct { // Registered clients. Clients map[*Client]bool // Inbound messages from the clients. Broadcast chan []byte // Register requests from the clients. Register chan *Client // Unregister requests from clients. Unregister chan *Client }
Hub maintains the set of active clients and broadcasts messages to the clients.
Click to show internal directories.
Click to hide internal directories.