Documentation ¶
Overview ¶
Package gotocol provides protocol support to send a variety of commands listener channels and types over a single channel type
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearTrace ¶
func ClearTrace()
Types ¶
type Context ¶
type Context struct {
Trace, Parent, Span TraceContextType
}
Context for capturing dapper/zipkin style traces
var NilContext Context
NilContext makes an empty context, I can't figure out how to make this a const
func (Context) NewParent ¶
NewParent sets up the parent by promoting incoming span id, and get a new spanid
type Impositions ¶
type Impositions int
Impositions is the promise theory term for requests made to a service
const ( // Hello ChanToParent Name Initial noodly touch to set identity Hello Impositions = iota // NameDrop ChanToBuddy NameOfBuddy Here's someone to talk to NameDrop // Chat - ThisOften Chat to buddies time interval Chat // GoldCoin FromChan HowMuch GoldCoin // Inform loggerChan text message Inform // GetRequest FromChan key Simulate http inbound request GetRequest // GetResponse FromChan value Simulate http outbound response GetResponse // Put - "key value" Save the key and value Put // Replicate - "key value" Save a replicated copy Replicate // Forget - FromBuddy ToBuddy Forget link between two buddies Forget // Delete - key Remove key and value Delete // Delay - delay node Delay //Final - End all Program Final // Goodbye - name // tell FSM and exit Goodbye // test assumes this is the last and exits )
Constant definitions for message types to be imposed on the receiver
func (Impositions) String ¶
func (imps Impositions) String() string
String handler to make imposition types printable
type Message ¶
type Message struct { Imposition Impositions // request type ResponseChan chan Message // place to send response messages Sent time.Time // time at which message was sent Ctx Context // message context Intention string // payload }
Message structure used for all messages, includes a channel of itself
func (Message) GoSend ¶
GoSend asynchronous message send, parks it on a new goroutine until it completes
type Routetype ¶
type Routetype struct { Ctx Context ResponseChan chan Message State int // state machine for managing responses }
Routetype information from a message
type TraceContextType ¶
type TraceContextType uint32 // needs to match type conversions in func increment below
TraceContextType needs to be exported for flow package map. For production scale use this should be 64bit, for spigo it seems ok with 32.