Documentation
¶
Index ¶
- func RegisterNetworkHandler(s server.Server, hdlr NetworkHandler, opts ...server.HandlerOption) error
- type Close
- func (*Close) Descriptor() ([]byte, []int)
- func (m *Close) GetNode() *Node
- func (*Close) ProtoMessage()
- func (m *Close) Reset()
- func (m *Close) String() string
- func (m *Close) XXX_DiscardUnknown()
- func (m *Close) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Close) XXX_Merge(src proto.Message)
- func (m *Close) XXX_Size() int
- func (m *Close) XXX_Unmarshal(b []byte) error
- type Connect
- func (*Connect) Descriptor() ([]byte, []int)
- func (m *Connect) GetNode() *Node
- func (*Connect) ProtoMessage()
- func (m *Connect) Reset()
- func (m *Connect) String() string
- func (m *Connect) XXX_DiscardUnknown()
- func (m *Connect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Connect) XXX_Merge(src proto.Message)
- func (m *Connect) XXX_Size() int
- func (m *Connect) XXX_Unmarshal(b []byte) error
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)
- func (*ListRequest) ProtoMessage()
- func (m *ListRequest) Reset()
- func (m *ListRequest) String() string
- func (m *ListRequest) XXX_DiscardUnknown()
- func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListRequest) XXX_Merge(src proto.Message)
- func (m *ListRequest) XXX_Size() int
- func (m *ListRequest) XXX_Unmarshal(b []byte) error
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)
- func (m *ListResponse) GetNodes() []*Node
- func (*ListResponse) ProtoMessage()
- func (m *ListResponse) Reset()
- func (m *ListResponse) String() string
- func (m *ListResponse) XXX_DiscardUnknown()
- func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListResponse) XXX_Merge(src proto.Message)
- func (m *ListResponse) XXX_Size() int
- func (m *ListResponse) XXX_Unmarshal(b []byte) error
- type Neighbour
- func (*Neighbour) Descriptor() ([]byte, []int)
- func (m *Neighbour) GetNeighbours() []*Node
- func (m *Neighbour) GetNode() *Node
- func (*Neighbour) ProtoMessage()
- func (m *Neighbour) Reset()
- func (m *Neighbour) String() string
- func (m *Neighbour) XXX_DiscardUnknown()
- func (m *Neighbour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Neighbour) XXX_Merge(src proto.Message)
- func (m *Neighbour) XXX_Size() int
- func (m *Neighbour) XXX_Unmarshal(b []byte) error
- type NeighbourhoodRequest
- func (*NeighbourhoodRequest) Descriptor() ([]byte, []int)
- func (m *NeighbourhoodRequest) GetId() string
- func (*NeighbourhoodRequest) ProtoMessage()
- func (m *NeighbourhoodRequest) Reset()
- func (m *NeighbourhoodRequest) String() string
- func (m *NeighbourhoodRequest) XXX_DiscardUnknown()
- func (m *NeighbourhoodRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NeighbourhoodRequest) XXX_Merge(src proto.Message)
- func (m *NeighbourhoodRequest) XXX_Size() int
- func (m *NeighbourhoodRequest) XXX_Unmarshal(b []byte) error
- type NeighbourhoodResponse
- func (*NeighbourhoodResponse) Descriptor() ([]byte, []int)
- func (m *NeighbourhoodResponse) GetNeighbourhood() *Neighbour
- func (*NeighbourhoodResponse) ProtoMessage()
- func (m *NeighbourhoodResponse) Reset()
- func (m *NeighbourhoodResponse) String() string
- func (m *NeighbourhoodResponse) XXX_DiscardUnknown()
- func (m *NeighbourhoodResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NeighbourhoodResponse) XXX_Merge(src proto.Message)
- func (m *NeighbourhoodResponse) XXX_Size() int
- func (m *NeighbourhoodResponse) XXX_Unmarshal(b []byte) error
- type NetworkHandler
- type NetworkService
- type Node
- func (*Node) Descriptor() ([]byte, []int)
- func (m *Node) GetAddress() string
- func (m *Node) GetId() string
- func (*Node) ProtoMessage()
- func (m *Node) Reset()
- func (m *Node) String() string
- func (m *Node) XXX_DiscardUnknown()
- func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Node) XXX_Merge(src proto.Message)
- func (m *Node) XXX_Size() int
- func (m *Node) XXX_Unmarshal(b []byte) error
- type Solicit
- func (*Solicit) Descriptor() ([]byte, []int)
- func (m *Solicit) GetNode() *Node
- func (*Solicit) ProtoMessage()
- func (m *Solicit) Reset()
- func (m *Solicit) String() string
- func (m *Solicit) XXX_DiscardUnknown()
- func (m *Solicit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Solicit) XXX_Merge(src proto.Message)
- func (m *Solicit) XXX_Size() int
- func (m *Solicit) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterNetworkHandler ¶
func RegisterNetworkHandler(s server.Server, hdlr NetworkHandler, opts ...server.HandlerOption) error
Types ¶
type Close ¶
type Close struct {
// network node
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Close is sent when the node disconnects from the network
func (*Close) Descriptor ¶
func (*Close) ProtoMessage ¶
func (*Close) ProtoMessage()
func (*Close) XXX_DiscardUnknown ¶
func (m *Close) XXX_DiscardUnknown()
func (*Close) XXX_Marshal ¶
func (*Close) XXX_Unmarshal ¶
type Connect ¶
type Connect struct {
// network mode
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Connect is sent when the node connects to the network
func (*Connect) Descriptor ¶
func (*Connect) ProtoMessage ¶
func (*Connect) ProtoMessage()
func (*Connect) XXX_DiscardUnknown ¶
func (m *Connect) XXX_DiscardUnknown()
func (*Connect) XXX_Marshal ¶
func (*Connect) XXX_Unmarshal ¶
type ListRequest ¶
type ListRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Empty request
func (*ListRequest) Descriptor ¶
func (*ListRequest) Descriptor() ([]byte, []int)
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) Reset ¶
func (m *ListRequest) Reset()
func (*ListRequest) String ¶
func (m *ListRequest) String() string
func (*ListRequest) XXX_DiscardUnknown ¶
func (m *ListRequest) XXX_DiscardUnknown()
func (*ListRequest) XXX_Marshal ¶
func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListRequest) XXX_Merge ¶
func (m *ListRequest) XXX_Merge(src proto.Message)
func (*ListRequest) XXX_Size ¶
func (m *ListRequest) XXX_Size() int
func (*ListRequest) XXX_Unmarshal ¶
func (m *ListRequest) XXX_Unmarshal(b []byte) error
type ListResponse ¶
type ListResponse struct {
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
ListResponse is returned by ListNodes and ListNeighbours
func (*ListResponse) Descriptor ¶
func (*ListResponse) Descriptor() ([]byte, []int)
func (*ListResponse) GetNodes ¶
func (m *ListResponse) GetNodes() []*Node
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) Reset ¶
func (m *ListResponse) Reset()
func (*ListResponse) String ¶
func (m *ListResponse) String() string
func (*ListResponse) XXX_DiscardUnknown ¶
func (m *ListResponse) XXX_DiscardUnknown()
func (*ListResponse) XXX_Marshal ¶
func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListResponse) XXX_Merge ¶
func (m *ListResponse) XXX_Merge(src proto.Message)
func (*ListResponse) XXX_Size ¶
func (m *ListResponse) XXX_Size() int
func (*ListResponse) XXX_Unmarshal ¶
func (m *ListResponse) XXX_Unmarshal(b []byte) error
type Neighbour ¶
type Neighbour struct {
// network node
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
// neighbours
Neighbours []*Node `protobuf:"bytes,3,rep,name=neighbours,proto3" json:"neighbours,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Neighbour is used to nnounce node neighbourhood
func (*Neighbour) Descriptor ¶
func (*Neighbour) GetNeighbours ¶
func (*Neighbour) ProtoMessage ¶
func (*Neighbour) ProtoMessage()
func (*Neighbour) XXX_DiscardUnknown ¶
func (m *Neighbour) XXX_DiscardUnknown()
func (*Neighbour) XXX_Marshal ¶
func (*Neighbour) XXX_Unmarshal ¶
type NeighbourhoodRequest ¶
type NeighbourhoodRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
NeighbourhoodRequest is sent to query node neighbourhood
func (*NeighbourhoodRequest) Descriptor ¶
func (*NeighbourhoodRequest) Descriptor() ([]byte, []int)
func (*NeighbourhoodRequest) GetId ¶
func (m *NeighbourhoodRequest) GetId() string
func (*NeighbourhoodRequest) ProtoMessage ¶
func (*NeighbourhoodRequest) ProtoMessage()
func (*NeighbourhoodRequest) Reset ¶
func (m *NeighbourhoodRequest) Reset()
func (*NeighbourhoodRequest) String ¶
func (m *NeighbourhoodRequest) String() string
func (*NeighbourhoodRequest) XXX_DiscardUnknown ¶
func (m *NeighbourhoodRequest) XXX_DiscardUnknown()
func (*NeighbourhoodRequest) XXX_Marshal ¶
func (m *NeighbourhoodRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NeighbourhoodRequest) XXX_Merge ¶
func (m *NeighbourhoodRequest) XXX_Merge(src proto.Message)
func (*NeighbourhoodRequest) XXX_Size ¶
func (m *NeighbourhoodRequest) XXX_Size() int
func (*NeighbourhoodRequest) XXX_Unmarshal ¶
func (m *NeighbourhoodRequest) XXX_Unmarshal(b []byte) error
type NeighbourhoodResponse ¶
type NeighbourhoodResponse struct {
Neighbourhood *Neighbour `protobuf:"bytes,1,opt,name=neighbourhood,proto3" json:"neighbourhood,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
NeighbourhoodResponse contains node neighbourhood hierarchy
func (*NeighbourhoodResponse) Descriptor ¶
func (*NeighbourhoodResponse) Descriptor() ([]byte, []int)
func (*NeighbourhoodResponse) GetNeighbourhood ¶
func (m *NeighbourhoodResponse) GetNeighbourhood() *Neighbour
func (*NeighbourhoodResponse) ProtoMessage ¶
func (*NeighbourhoodResponse) ProtoMessage()
func (*NeighbourhoodResponse) Reset ¶
func (m *NeighbourhoodResponse) Reset()
func (*NeighbourhoodResponse) String ¶
func (m *NeighbourhoodResponse) String() string
func (*NeighbourhoodResponse) XXX_DiscardUnknown ¶
func (m *NeighbourhoodResponse) XXX_DiscardUnknown()
func (*NeighbourhoodResponse) XXX_Marshal ¶
func (m *NeighbourhoodResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NeighbourhoodResponse) XXX_Merge ¶
func (m *NeighbourhoodResponse) XXX_Merge(src proto.Message)
func (*NeighbourhoodResponse) XXX_Size ¶
func (m *NeighbourhoodResponse) XXX_Size() int
func (*NeighbourhoodResponse) XXX_Unmarshal ¶
func (m *NeighbourhoodResponse) XXX_Unmarshal(b []byte) error
type NetworkHandler ¶
type NetworkHandler interface {
ListRoutes(context.Context, *proto1.Request, *proto1.ListResponse) error
ListNodes(context.Context, *ListRequest, *ListResponse) error
Neighbourhood(context.Context, *NeighbourhoodRequest, *NeighbourhoodResponse) error
}
type NetworkService ¶
type NetworkService interface {
ListRoutes(ctx context.Context, in *proto1.Request, opts ...client.CallOption) (*proto1.ListResponse, error)
ListNodes(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
Neighbourhood(ctx context.Context, in *NeighbourhoodRequest, opts ...client.CallOption) (*NeighbourhoodResponse, error)
}
func NewNetworkService ¶
func NewNetworkService(name string, c client.Client) NetworkService
type Node ¶
type Node struct {
// node ide
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// node address
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Node is network node
func (*Node) Descriptor ¶
func (*Node) GetAddress ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) XXX_DiscardUnknown ¶
func (m *Node) XXX_DiscardUnknown()
func (*Node) XXX_Unmarshal ¶
type Solicit ¶
type Solicit struct {
// network node
Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Solicit is sent when requesting route advertisement from the network nodes
func (*Solicit) Descriptor ¶
func (*Solicit) ProtoMessage ¶
func (*Solicit) ProtoMessage()
func (*Solicit) XXX_DiscardUnknown ¶
func (m *Solicit) XXX_DiscardUnknown()
func (*Solicit) XXX_Marshal ¶
func (*Solicit) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.