ccp

package
v0.0.0-...-add61a3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolExpiration = time.Second * 60

	PeerDestinationPrefix       = "peer.route"
	PeerDestinationRouteControl = PeerDestinationPrefix + ".control"
	PeerDestinationRouteUpdate  = PeerDestinationPrefix + ".update"
)
View Source
const (
	ModeIdle = iota
	ModeSync
)

Variables

View Source
var (
	ModeToString = map[uint8]string{
		ModeSync: "MODE_SYNC",
		ModeIdle: "MODE_IDLE",
	}
)
View Source
var (
	PeerRoutingExecutionCondition, _ = base64.StdEncoding.DecodeString("Zmh6rfhivXdsj8GLjp+OIAiXFIVu4jOzkCpZHQ1fKSU=")
)

Functions

func DecodeMessage

func DecodeMessage(destination ilp.Address, ccpData []byte) (interface{}, error)

func EncodeMessage

func EncodeMessage(msg interface{}) (ilp.Address, []byte, error)

Types

type Route

type Route struct {
	Prefix ilp.Address
	Path   []ilp.Address
	Auth   [authLength]byte
	Props  []*RouteProp
}

func (*Route) MarshalOER

func (r *Route) MarshalOER(enc *oer.Encoder) error

func (*Route) UnmarshalOER

func (r *Route) UnmarshalOER(dec *oer.Decoder) error

type RouteControlRequest

type RouteControlRequest struct {
	Mode                    uint8
	LastKnownRoutingTableId string
	LastKnownEpoch          uint32
	Features                [][]byte
}

func (*RouteControlRequest) MarshalOER

func (m *RouteControlRequest) MarshalOER(enc *oer.Encoder) error

func (*RouteControlRequest) UnmarshalOER

func (m *RouteControlRequest) UnmarshalOER(dec *oer.Decoder) error

type RouteProp

type RouteProp struct {
	Meta uint8

	// Buffer or string
	Id    uint16
	Value []byte // stays byte for buffer, converted to string if utf8
}

func (*RouteProp) IsOptional

func (p *RouteProp) IsOptional() bool

func (*RouteProp) IsPartial

func (p *RouteProp) IsPartial() bool

func (*RouteProp) IsTransitive

func (p *RouteProp) IsTransitive() bool

func (*RouteProp) IsUTF8

func (p *RouteProp) IsUTF8() bool

type RouteUpdateRequest

type RouteUpdateRequest struct {
	RoutingTableID    string
	CurrentEpochIndex uint32
	FromEpochIndex    uint32
	ToEpochIndex      uint32
	HoldDownTime      time.Duration
	Speaker           ilp.Address
	NewRoutes         []Route
	WithdrawnRoutes   []ilp.Address
}

func (*RouteUpdateRequest) MarshalOER

func (m *RouteUpdateRequest) MarshalOER(enc *oer.Encoder) error

func (*RouteUpdateRequest) UnmarshalOER

func (m *RouteUpdateRequest) UnmarshalOER(dec *oer.Decoder) error

Jump to

Keyboard shortcuts

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