model

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MsgTypeInit    byte = 0
	MsgTypeControl byte = 1
	MsgTypeData    byte = 2
	MsgTypeEnd     byte = 3
)
View Source
const (
	ShipProtocolId = "ee1.0"
)

Variables

View Source
var ShipInit []byte = []byte{MsgTypeInit, 0x00}

Functions

This section is empty.

Types

type AccessMethods

type AccessMethods struct {
	AccessMethods AccessMethodsType `json:"accessMethods"`
}

type AccessMethodsRequest

type AccessMethodsRequest struct {
	AccessMethodsRequest AccessMethodsRequestType `json:"accessMethodsRequest"`
}

type AccessMethodsRequestType

type AccessMethodsRequestType struct{}

type AccessMethodsType

type AccessMethodsType struct {
	Id        *string    `json:"id"`
	DnsSdMDns *DnsSdMDns `json:"dnsSd_mDns,omitempty"`
	// According to the Spec Dns should be of type *Dns, but the SHM 2.0 only uses a string and would cause a crash
	Dns *string `json:"dns,omitempty"`
}

type ConnectionClose

type ConnectionClose struct {
	ConnectionClose ConnectionCloseType `json:"connectionClose"`
}

type ConnectionClosePhaseType

type ConnectionClosePhaseType string
const (
	ConnectionClosePhaseTypeAnnounce ConnectionClosePhaseType = "announce"
	ConnectionClosePhaseTypeConfirm  ConnectionClosePhaseType = "confirm"
)

type ConnectionCloseReasonType

type ConnectionCloseReasonType string
const (
	ConnectionCloseReasonTypeUnspecific        ConnectionCloseReasonType = "unspecific"
	ConnectionCloseReasonTypeRemovedconnection ConnectionCloseReasonType = "removedConnection"
)

type ConnectionCloseType

type ConnectionCloseType struct {
	Phase   ConnectionClosePhaseType   `json:"phase"`
	MaxTime *uint                      `json:"maxTime,omitempty"`
	Reason  *ConnectionCloseReasonType `json:"reason,omitempty"`
}

type ConnectionHello

type ConnectionHello struct {
	ConnectionHello ConnectionHelloType `json:"connectionHello"`
}

type ConnectionHelloPhaseType

type ConnectionHelloPhaseType string
const (
	ConnectionHelloPhaseTypePending ConnectionHelloPhaseType = "pending"
	ConnectionHelloPhaseTypeReady   ConnectionHelloPhaseType = "ready"
	ConnectionHelloPhaseTypeAborted ConnectionHelloPhaseType = "aborted"
)

type ConnectionHelloType

type ConnectionHelloType struct {
	Phase               ConnectionHelloPhaseType `json:"phase"`
	Waiting             *uint                    `json:"waiting,omitempty"`
	ProlongationRequest *bool                    `json:"prolongationRequest,omitempty"`
}

type ConnectionPinErrorErrorType

type ConnectionPinErrorErrorType uint8

type ConnectionPinErrorType

type ConnectionPinErrorType struct {
	Error ConnectionPinErrorErrorType `json:"error"`
}

type ConnectionPinInputType

type ConnectionPinInputType struct {
	Pin PinValueType `json:"pin"`
}

type ConnectionPinState

type ConnectionPinState struct {
	ConnectionPinState ConnectionPinStateType `json:"connectionPinState"`
}

type ConnectionPinStateType

type ConnectionPinStateType struct {
	PinState        PinStateType            `json:"pinState"`
	InputPermission *PinInputPermissionType `json:"inputPermission,omitempty"`
}

type DataType

type DataType struct {
	Header    HeaderType      `json:"header"`
	Payload   json.RawMessage `json:"payload"`
	Extension *ExtensionType  `json:"extension,omitempty"`
}

type Dns

type Dns struct {
	Uri string `json:"uri"`
}

type DnsSdMDns

type DnsSdMDns struct {
}

type ExtensionType

type ExtensionType struct {
	ExtensionId *string `json:"extensionId,omitempty"`
	Binary      *byte   `json:"binary,omitempty"` // HexBinary
	String      *string `json:"string,omitempty"`
}

type HeaderType

type HeaderType struct {
	ProtocolId ProtocolIdType `json:"protocolId"`
}

type MessageProtocolFormatType

type MessageProtocolFormatType string
const (
	MessageProtocolFormatTypeUTF8  MessageProtocolFormatType = "JSON-UTF8"
	MessageProtocolFormatTypeUTF16 MessageProtocolFormatType = "JSON-UTF16"
)

type MessageProtocolFormatsType

type MessageProtocolFormatsType struct {
	Format []MessageProtocolFormatType `json:"format"`
}

type MessageProtocolHandshake

type MessageProtocolHandshake struct {
	MessageProtocolHandshake MessageProtocolHandshakeType `json:"messageProtocolHandshake"`
}

type MessageProtocolHandshakeError

type MessageProtocolHandshakeError struct {
	Error MessageProtocolHandshakeErrorErrorType `json:"error"`
}

type MessageProtocolHandshakeErrorErrorType

type MessageProtocolHandshakeErrorErrorType uint8
const (
	MessageProtocolHandshakeErrorErrorTypeRFU               MessageProtocolHandshakeErrorErrorType = 0
	MessageProtocolHandshakeErrorErrorTypeTimeout           MessageProtocolHandshakeErrorErrorType = 1
	MessageProtocolHandshakeErrorErrorTypeUnexpectedMessage MessageProtocolHandshakeErrorErrorType = 2
	MessageProtocolHandshakeErrorErrorTypeSelectionMismatch MessageProtocolHandshakeErrorErrorType = 3
)

type MessageProtocolHandshakeErrorType

type MessageProtocolHandshakeErrorType struct {
	Error MessageProtocolHandshakeErrorErrorType `json:"error"`
}

type MessageProtocolHandshakeType

type MessageProtocolHandshakeType struct {
	HandshakeType ProtocolHandshakeTypeType  `json:"handshakeType"`
	Version       Version                    `json:"version"`
	Formats       MessageProtocolFormatsType `json:"formats"`
}

type PinInputPermissionType

type PinInputPermissionType string
const (
	PinInputPermissionTypeBusy PinInputPermissionType = "busy"
	PinInputPermissionTypeOk   PinInputPermissionType = "ok"
)

type PinStateType

type PinStateType string
const (
	PinStateTypeRequired PinStateType = "required"
	PinStateTypeOptional PinStateType = "optional"
	PinStateTypePinOk    PinStateType = "pinOk"
	PinStateTypeNone     PinStateType = "none"
)

type PinValueType

type PinValueType string

type ProtocolHandshakeTypeType

type ProtocolHandshakeTypeType string
const (
	ProtocolHandshakeTypeTypeAnnounceMax ProtocolHandshakeTypeType = "announceMax"
	ProtocolHandshakeTypeTypeSelect      ProtocolHandshakeTypeType = "select"
)

type ProtocolIdType

type ProtocolIdType string

type ShipData

type ShipData struct {
	Data DataType `json:"data"`
}

type ShipMessageExchangeState

type ShipMessageExchangeState uint
const (
	// Connection Mode Initialisation (CMI) SHIP 13.4.3
	CmiStateInitStart      ShipMessageExchangeState = 0
	CmiStateClientSend     ShipMessageExchangeState = 1
	CmiStateClientWait     ShipMessageExchangeState = 2
	CmiStateClientEvaluate ShipMessageExchangeState = 3
	CmiStateServerWait     ShipMessageExchangeState = 4
	CmiStateServerEvaluate ShipMessageExchangeState = 5
	// Connection Data Preparation SHIP 13.4.4
	SmeHelloState                ShipMessageExchangeState = 6
	SmeHelloStateReadyInit       ShipMessageExchangeState = 7
	SmeHelloStateReadyListen     ShipMessageExchangeState = 8
	SmeHelloStateReadyTimeout    ShipMessageExchangeState = 9
	SmeHelloStatePendingInit     ShipMessageExchangeState = 10
	SmeHelloStatePendingListen   ShipMessageExchangeState = 11
	SmeHelloStatePendingTimeout  ShipMessageExchangeState = 12
	SmeHelloStateOk              ShipMessageExchangeState = 13
	SmeHelloStateAbort           ShipMessageExchangeState = 14 // Sent abort to remote
	SmeHelloStateAbortDone       ShipMessageExchangeState = 15 // Sending abort to remote is done
	SmeHelloStateRemoteAbortDone ShipMessageExchangeState = 16 // Received abort from remote
	SmeHelloStateRejected        ShipMessageExchangeState = 17 // Connection closed after remote pending: "4452: Node rejected by application"

	// Connection State Protocol Handhsake SHIP 13.4.4.2
	SmeProtHStateServerInit           ShipMessageExchangeState = 18
	SmeProtHStateClientInit           ShipMessageExchangeState = 19
	SmeProtHStateServerListenProposal ShipMessageExchangeState = 20
	SmeProtHStateServerListenConfirm  ShipMessageExchangeState = 21
	SmeProtHStateClientListenChoice   ShipMessageExchangeState = 22
	SmeProtHStateTimeout              ShipMessageExchangeState = 23
	SmeProtHStateClientOk             ShipMessageExchangeState = 24
	SmeProtHStateServerOk             ShipMessageExchangeState = 25
	// Connection PIN State 13.4.5
	SmePinStateCheckInit     ShipMessageExchangeState = 26
	SmePinStateCheckListen   ShipMessageExchangeState = 27
	SmePinStateCheckError    ShipMessageExchangeState = 28
	SmePinStateCheckBusyInit ShipMessageExchangeState = 29
	SmePinStateCheckBusyWait ShipMessageExchangeState = 30
	SmePinStateCheckOk       ShipMessageExchangeState = 31
	SmePinStateAskInit       ShipMessageExchangeState = 32
	SmePinStateAskProcess    ShipMessageExchangeState = 33
	SmePinStateAskRestricted ShipMessageExchangeState = 34
	SmePinStateAskOk         ShipMessageExchangeState = 35
	// ConnectionAccess Methods Identification 13.4.6
	SmeAccessMethodsRequest ShipMessageExchangeState = 36

	// Handshake approved on both ends
	SmeStateApproved ShipMessageExchangeState = 37

	// Handshake process is successfully completed
	SmeStateComplete ShipMessageExchangeState = 38

	// Handshake ended with an error
	SmeStateError ShipMessageExchangeState = 39
)

set the values manually instead of using iota, so log data can be associated easier

type ShipState

type ShipState struct {
	State ShipMessageExchangeState
	Error error
}

type Version

type Version struct {
	Major uint8 `json:"major"`
	Minor uint8 `json:"minor"`
}

Jump to

Keyboard shortcuts

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