message

package
v0.0.0-...-682d07f Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capability

type Capability string

Capability is a urn of a capability

const (
	//NoCapability is used when the server does not listen for any connections
	NoCapability Capability = "urn:x-rains:nocapability"
	//TLSOverTCP is used when the server listens for tls over tcp connections
	TLSOverTCP Capability = "urn:x-rains:tlssrv"
)

type Message

type Message struct {
	//Capabilities is a slice of capabilities or the hash thereof which the server originating the
	//message has.
	Capabilities []Capability
	//Token is used to identify a message
	Token token.Token
	//Content is a slice of
	Content []section.Section
	//Signatures authenticate the content of this message. An encoding of Message is signed by the infrastructure key of the originating server.
	Signatures []signature.Sig
}

Message represents a Message

func (*Message) MarshalCBOR

func (rm *Message) MarshalCBOR(w *cbor.CBORWriter) error

MarshalCBOR writes the RAINS message to the provided writer. Implements the CBORMarshaler interface.

func (*Message) Query

func (m *Message) Query() *query.Name

Query returns the first section in the messages content if it is a query. It panics if the message has no content.

func (*Message) Sort

func (m *Message) Sort()

Sort sorts the sections in m.Content first by Message Section Type Codes (see RAINS Protocol Specification) and second the sections of equal type according to their sort function.

func (*Message) UnmarshalCBOR

func (rm *Message) UnmarshalCBOR(r *cbor.CBORReader) error

Jump to

Keyboard shortcuts

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