register

package
v1.0.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RegistrationDeadlineSeconds = 10

Variables

This section is empty.

Functions

func Register

func Register(url string, caCert []byte, smbios bool, emulatedTPM bool, emulatedSeed int64) ([]byte, error)

func SendJSONData

func SendJSONData(conn *websocket.Conn, msgType MessageType, data interface{}) error

SendJSONData transmits json encoded data to the websocket connection, attaching to it msgType. It needs a `MsgReady` reply on the websocket channel in order to report a successful transmission

func WriteMessage

func WriteMessage(conn *websocket.Conn, msgType MessageType, data []byte) error

WriteMessage attaches msgType to the actual data before sending it to the websocket connection

Types

type MessageType

type MessageType byte
const (
	MsgUndefined MessageType = iota
	MsgReady
	MsgSmbios
	MsgLabels
	MsgGet
	MsgLast = MsgGet // MsgLast must point to the last message
)

func ReadMessage

func ReadMessage(conn *websocket.Conn) (MessageType, []byte, error)

ReadMessage reads from the websocket connection returning the MessageType and the actual data

func (MessageType) String

func (mt MessageType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL