Documentation ¶
Overview ¶
Package infra contains common definitions for the SCION infrastructure messaging layer.
Index ¶
Constants ¶
View Source
const ( StrCtxDoneError = "context canceled" StrClosedError = "layer closed" StrAdapterError = "msg adapter error" StrInternalError = "internal error" StrTransportError = "transport error" )
Variables ¶
View Source
var ( // MessengerContextKey is a context key. It can be used in SCION infra // request handlers to access the messaging layer the message arrived on. MessengerContextKey = &contextKey{"infra-messenger"} )
Functions ¶
func NewCtxDoneError ¶
func NewCtxDoneError(ctx ...interface{}) error
Types ¶
type Handler ¶
type Handler interface {
Handle(*Request)
}
Interface Handler is implemented by objects that can handle a request coming from a remote SCION network node.
type HandlerFunc ¶
type HandlerFunc func(r *Request)
Constructs a handler for request r. Handle() can be called on the resulting object to process the message.
func (HandlerFunc) Handle ¶
func (f HandlerFunc) Handle(r *Request)
type Messenger ¶
type Messenger interface { GetTRC(ctx context.Context, msg *cert_mgmt.TRCReq, a net.Addr, id uint64) (*cert_mgmt.TRC, error) SendTRC(ctx context.Context, msg *cert_mgmt.TRC, a net.Addr, id uint64) error GetCertChain(ctx context.Context, msg *cert_mgmt.ChainReq, a net.Addr, id uint64) (*cert_mgmt.Chain, error) SendCertChain(ctx context.Context, msg *cert_mgmt.Chain, a net.Addr, id uint64) error AddHandler(msgType string, h Handler) ListenAndServe() CloseServer() error }
type Request ¶
type Request struct { // The inner proto.Cerealizable message, as supported by // messenger.Messenger (e.g., a *cert_mgmt.ChainReq). For information about // possible messages, see the package documentation for that package. Message proto.Cerealizable // The top-level SignedCtrlPld message read from the wire FullMessage proto.Cerealizable // The node that sent this request Peer net.Addr ID uint64 // contains filtered or unexported fields }
Request describes an object received from the network that is not part of an exchange initiated by the local node. A Request includes its associated context.
func NewRequest ¶
type TrustDescriptor ¶
type TrustDescriptor struct { }
type TrustStore ¶
Directories ¶
Path | Synopsis |
---|---|
Package disp implements a generic message dispatcher for request/reply protocols.
|
Package disp implements a generic message dispatcher for request/reply protocols. |
Package messenger contains the default implementation for interface infra.Messenger.
|
Package messenger contains the default implementation for interface infra.Messenger. |
Click to show internal directories.
Click to hide internal directories.