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 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
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 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:"-"` }
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 mode 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 NetworkHandler ¶
type NetworkHandler interface { ListRoutes(context.Context, *proto1.Request, *proto1.ListResponse) error ListNodes(context.Context, *ListRequest, *ListResponse) error ListNeighbours(context.Context, *ListRequest, *ListResponse) 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) ListNeighbours(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, 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 ¶
Click to show internal directories.
Click to hide internal directories.