Documentation
¶
Index ¶
Constants ¶
View Source
const ( PROTOCOL_NAME = "handshake" PROTOCOL_ID = 0 DIFFUSION_MODE_INITIATOR_ONLY = true DIFFUSION_MODE_INITIATOR_AND_RESPONDER = false )
View Source
const ( MESSAGE_TYPE_PROPOSE_VERSIONS = 0 MESSAGE_TYPE_ACCEPT_VERSION = 1 MESSAGE_TYPE_REFUSE = 2 REFUSE_REASON_VERSION_MISMATCH = 0 REFUSE_REASON_DECODE_ERROR = 1 REFUSE_REASON_REFUSED = 2 )
Variables ¶
View Source
var ( STATE_PROPOSE = protocol.NewState(1, "Propose") STATE_CONFIRM = protocol.NewState(2, "Confirm") STATE_DONE = protocol.NewState(3, "Done") )
View Source
var StateMap = protocol.StateMap{ STATE_PROPOSE: protocol.StateMapEntry{ Agency: protocol.AGENCY_CLIENT, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_PROPOSE_VERSIONS, NewState: STATE_CONFIRM, }, }, }, STATE_CONFIRM: protocol.StateMapEntry{ Agency: protocol.AGENCY_SERVER, Transitions: []protocol.StateTransition{ { MsgType: MESSAGE_TYPE_ACCEPT_VERSION, NewState: STATE_DONE, }, { MsgType: MESSAGE_TYPE_REFUSE, NewState: STATE_DONE, }, }, }, STATE_DONE: protocol.StateMapEntry{ Agency: protocol.AGENCY_NONE, }, }
Functions ¶
Types ¶
type Handshake ¶
type MsgAcceptVersion ¶ added in v0.10.0
type MsgAcceptVersion struct { protocol.MessageBase Version uint16 VersionData interface{} }
func NewMsgAcceptVersion ¶ added in v0.10.0
func NewMsgAcceptVersion(version uint16, versionData interface{}) *MsgAcceptVersion
type MsgProposeVersions ¶ added in v0.10.0
type MsgProposeVersions struct { protocol.MessageBase VersionMap map[uint16]interface{} }
func NewMsgProposeVersions ¶ added in v0.10.0
func NewMsgProposeVersions(versionMap map[uint16]interface{}) *MsgProposeVersions
type MsgRefuse ¶ added in v0.10.0
type MsgRefuse struct { protocol.MessageBase Reason []interface{} }
Click to show internal directories.
Click to hide internal directories.