Documentation ¶
Overview ¶
mocks package only contains mock interfaces for testing. Using "no_mocks" build tag to skip them in compiling
Index ¶
- func PipeTransport() (*MemoryTransport, *MemoryTransport)
- type ChordClient
- func (c *ChordClient) Acquire(ctx context.Context, req *protocol.LeaseRequest) (*protocol.LeaseResponse, error)
- func (c *ChordClient) Append(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
- func (c *ChordClient) Contains(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
- func (c *ChordClient) Delete(ctx context.Context, req *protocol.SimpleRequest) (*protocol.SimpleResponse, error)
- func (c *ChordClient) FindSuccessor(ctx context.Context, req *protocol.FindSuccessorRequest) (*protocol.FindSuccessorResponse, error)
- func (c *ChordClient) FinishJoin(ctx context.Context, req *protocol.MembershipConclusionRequest) (*protocol.MembershipConclusionResponse, error)
- func (c *ChordClient) FinishLeave(ctx context.Context, req *protocol.MembershipConclusionRequest) (*protocol.MembershipConclusionResponse, error)
- func (c *ChordClient) Get(ctx context.Context, req *protocol.SimpleRequest) (*protocol.SimpleResponse, error)
- func (c *ChordClient) GetPredecessor(ctx context.Context, req *protocol.GetPredecessorRequest) (*protocol.GetPredecessorResponse, error)
- func (c *ChordClient) GetSuccessors(ctx context.Context, req *protocol.GetSuccessorsRequest) (*protocol.GetSuccessorsResponse, error)
- func (c *ChordClient) Identity(ctx context.Context, req *protocol.IdentityRequest) (*protocol.IdentityResponse, error)
- func (c *ChordClient) Import(_ context.Context, _ *protocol.ImportRequest) (*protocol.ImportResponse, error)
- func (c *ChordClient) List(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
- func (c *ChordClient) ListKeys(_ context.Context, _ *protocol.ListKeysRequest) (*protocol.ListKeysResponse, error)
- func (c *ChordClient) Notify(ctx context.Context, req *protocol.NotifyRequest) (*protocol.NotifyResponse, error)
- func (c *ChordClient) Ping(ctx context.Context, req *protocol.PingRequest) (*protocol.PingResponse, error)
- func (c *ChordClient) Put(ctx context.Context, req *protocol.SimpleRequest) (*protocol.SimpleResponse, error)
- func (c *ChordClient) RatePer(interval time.Duration) float64
- func (c *ChordClient) Release(ctx context.Context, req *protocol.LeaseRequest) (*protocol.LeaseResponse, error)
- func (c *ChordClient) Remove(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
- func (c *ChordClient) Renew(ctx context.Context, req *protocol.LeaseRequest) (*protocol.LeaseResponse, error)
- func (c *ChordClient) RequestToJoin(ctx context.Context, req *protocol.RequestToJoinRequest) (*protocol.RequestToJoinResponse, error)
- func (c *ChordClient) RequestToLeave(ctx context.Context, req *protocol.RequestToLeaveRequest) (*protocol.RequestToLeaveResponse, error)
- type Measurement
- type MemoryTransport
- func (t *MemoryTransport) AcceptStream() <-chan *transport.StreamDelegate
- func (t *MemoryTransport) DialStream(ctx context.Context, peer *protocol.Node, kind protocol.Stream_Type) (net.Conn, error)
- func (t *MemoryTransport) Identity() *protocol.Node
- func (t *MemoryTransport) ListConnected() []transport.ConnectedPeer
- func (t *MemoryTransport) ReceiveDatagram() <-chan *transport.DatagramDelegate
- func (t *MemoryTransport) SendDatagram(_ *protocol.Node, _ []byte) error
- func (t *MemoryTransport) SupportDatagram() bool
- func (t *MemoryTransport) WithCertificate(cert *x509.Certificate)
- func (t *MemoryTransport) WithClientCertificate(cert tls.Certificate) error
- type PKIClient
- type Resolver
- type Transport
- func (t *Transport) AcceptStream() <-chan *transport.StreamDelegate
- func (t *Transport) DialStream(ctx context.Context, peer *protocol.Node, kind protocol.Stream_Type) (net.Conn, error)
- func (t *Transport) Identity() *protocol.Node
- func (t *Transport) ListConnected() []transport.ConnectedPeer
- func (t *Transport) ReceiveDatagram() <-chan *transport.DatagramDelegate
- func (t *Transport) SendDatagram(n *protocol.Node, b []byte) error
- func (t *Transport) SupportDatagram() bool
- func (t *Transport) TransportDestroyed() <-chan *protocol.Node
- func (t *Transport) TransportEstablished() <-chan *protocol.Node
- type TunnelServer
- type TunnelService
- func (t *TunnelService) AcmeInstruction(ctx context.Context, req *protocol.InstructionRequest) (*protocol.InstructionResponse, error)
- func (t *TunnelService) AcmeValidate(ctx context.Context, req *protocol.ValidateRequest) (*protocol.ValidateResponse, error)
- func (t *TunnelService) GenerateHostname(ctx context.Context, req *protocol.GenerateHostnameRequest) (*protocol.GenerateHostnameResponse, error)
- func (t *TunnelService) GetNodes(ctx context.Context, req *protocol.GetNodesRequest) (*protocol.GetNodesResponse, error)
- func (t *TunnelService) Ping(ctx context.Context, req *protocol.ClientPingRequest) (*protocol.ClientPingResponse, error)
- func (t *TunnelService) PublishTunnel(ctx context.Context, req *protocol.PublishTunnelRequest) (*protocol.PublishTunnelResponse, error)
- func (t *TunnelService) RegisterIdentity(ctx context.Context, req *protocol.RegisterIdentityRequest) (*protocol.RegisterIdentityResponse, error)
- func (t *TunnelService) RegisteredHostnames(ctx context.Context, req *protocol.RegisteredHostnamesRequest) (*protocol.RegisteredHostnamesResponse, error)
- func (t *TunnelService) ReleaseTunnel(ctx context.Context, req *protocol.ReleaseTunnelRequest) (*protocol.ReleaseTunnelResponse, error)
- func (t *TunnelService) UnpublishTunnel(ctx context.Context, req *protocol.UnpublishTunnelRequest) (*protocol.UnpublishTunnelResponse, error)
- type VNode
- func (n *VNode) Acquire(ctx context.Context, lease []byte, ttl time.Duration) (token uint64, err error)
- func (n *VNode) Delete(ctx context.Context, key []byte) error
- func (n *VNode) FindSuccessor(key uint64) (chord.VNode, error)
- func (n *VNode) FinishJoin(stabilize bool, release bool) error
- func (n *VNode) FinishLeave(stabilize bool, release bool) error
- func (n *VNode) Get(ctx context.Context, key []byte) (value []byte, err error)
- func (n *VNode) GetPredecessor() (chord.VNode, error)
- func (n *VNode) GetSuccessors() ([]chord.VNode, error)
- func (n *VNode) ID() uint64
- func (n *VNode) Identity() *protocol.Node
- func (n *VNode) Import(ctx context.Context, keys [][]byte, values []*protocol.KVTransfer) error
- func (n *VNode) ListKeys(ctx context.Context, prefix []byte) ([]*protocol.KeyComposite, error)
- func (n *VNode) Notify(predecessor chord.VNode) error
- func (n *VNode) Ping() error
- func (n *VNode) PrefixAppend(ctx context.Context, prefix []byte, child []byte) error
- func (n *VNode) PrefixContains(ctx context.Context, prefix []byte, child []byte) (bool, error)
- func (n *VNode) PrefixList(ctx context.Context, prefix []byte) ([][]byte, error)
- func (n *VNode) PrefixRemove(ctx context.Context, prefix []byte, child []byte) error
- func (n *VNode) Put(ctx context.Context, key []byte, value []byte) error
- func (n *VNode) Release(ctx context.Context, lease []byte, token uint64) error
- func (n *VNode) Renew(ctx context.Context, lease []byte, ttl time.Duration, prevToken uint64) (newToken uint64, err error)
- func (n *VNode) RequestToJoin(joiner chord.VNode) (chord.VNode, []chord.VNode, error)
- func (n *VNode) RequestToLeave(leaver chord.VNode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PipeTransport ¶
func PipeTransport() (*MemoryTransport, *MemoryTransport)
PipeTransport returns two transport.Transport that when one side's .DialStream() is invoked, .AcceptStream() on the other Transport will receive the net.Conn
Types ¶
type ChordClient ¶
func (*ChordClient) Acquire ¶
func (c *ChordClient) Acquire(ctx context.Context, req *protocol.LeaseRequest) (*protocol.LeaseResponse, error)
func (*ChordClient) Append ¶
func (c *ChordClient) Append(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
func (*ChordClient) Contains ¶
func (c *ChordClient) Contains(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
func (*ChordClient) Delete ¶
func (c *ChordClient) Delete(ctx context.Context, req *protocol.SimpleRequest) (*protocol.SimpleResponse, error)
func (*ChordClient) FindSuccessor ¶
func (c *ChordClient) FindSuccessor(ctx context.Context, req *protocol.FindSuccessorRequest) (*protocol.FindSuccessorResponse, error)
func (*ChordClient) FinishJoin ¶
func (c *ChordClient) FinishJoin(ctx context.Context, req *protocol.MembershipConclusionRequest) (*protocol.MembershipConclusionResponse, error)
func (*ChordClient) FinishLeave ¶
func (c *ChordClient) FinishLeave(ctx context.Context, req *protocol.MembershipConclusionRequest) (*protocol.MembershipConclusionResponse, error)
func (*ChordClient) Get ¶
func (c *ChordClient) Get(ctx context.Context, req *protocol.SimpleRequest) (*protocol.SimpleResponse, error)
func (*ChordClient) GetPredecessor ¶
func (c *ChordClient) GetPredecessor(ctx context.Context, req *protocol.GetPredecessorRequest) (*protocol.GetPredecessorResponse, error)
func (*ChordClient) GetSuccessors ¶
func (c *ChordClient) GetSuccessors(ctx context.Context, req *protocol.GetSuccessorsRequest) (*protocol.GetSuccessorsResponse, error)
func (*ChordClient) Identity ¶
func (c *ChordClient) Identity(ctx context.Context, req *protocol.IdentityRequest) (*protocol.IdentityResponse, error)
func (*ChordClient) Import ¶
func (c *ChordClient) Import(_ context.Context, _ *protocol.ImportRequest) (*protocol.ImportResponse, error)
func (*ChordClient) List ¶
func (c *ChordClient) List(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
func (*ChordClient) ListKeys ¶
func (c *ChordClient) ListKeys(_ context.Context, _ *protocol.ListKeysRequest) (*protocol.ListKeysResponse, error)
func (*ChordClient) Notify ¶
func (c *ChordClient) Notify(ctx context.Context, req *protocol.NotifyRequest) (*protocol.NotifyResponse, error)
func (*ChordClient) Ping ¶
func (c *ChordClient) Ping(ctx context.Context, req *protocol.PingRequest) (*protocol.PingResponse, error)
func (*ChordClient) Put ¶
func (c *ChordClient) Put(ctx context.Context, req *protocol.SimpleRequest) (*protocol.SimpleResponse, error)
func (*ChordClient) Release ¶
func (c *ChordClient) Release(ctx context.Context, req *protocol.LeaseRequest) (*protocol.LeaseResponse, error)
func (*ChordClient) Remove ¶
func (c *ChordClient) Remove(ctx context.Context, req *protocol.PrefixRequest) (*protocol.PrefixResponse, error)
func (*ChordClient) Renew ¶
func (c *ChordClient) Renew(ctx context.Context, req *protocol.LeaseRequest) (*protocol.LeaseResponse, error)
func (*ChordClient) RequestToJoin ¶
func (c *ChordClient) RequestToJoin(ctx context.Context, req *protocol.RequestToJoinRequest) (*protocol.RequestToJoinResponse, error)
func (*ChordClient) RequestToLeave ¶
func (c *ChordClient) RequestToLeave(ctx context.Context, req *protocol.RequestToLeaveRequest) (*protocol.RequestToLeaveResponse, error)
type Measurement ¶
func (*Measurement) Drop ¶
func (m *Measurement) Drop(key string)
func (*Measurement) RecordLatency ¶
func (m *Measurement) RecordLatency(key string, latency float64)
func (*Measurement) RecordLost ¶
func (m *Measurement) RecordLost(key string)
func (*Measurement) RecordSent ¶
func (m *Measurement) RecordSent(key string)
func (*Measurement) Snapshot ¶
func (m *Measurement) Snapshot(key string, past time.Duration) *rtt.Statistics
type MemoryTransport ¶
type MemoryTransport struct { Identify *protocol.Node Other chan *transport.StreamDelegate Self chan *transport.StreamDelegate Certificate *x509.Certificate mock.Mock }
func SelfTransport ¶
func SelfTransport() *MemoryTransport
SelfTransport returns a transport.Transport that when .DialStream() is invoked, .AcceptStream() on the same Transport will receive the net.Conn
func (*MemoryTransport) AcceptStream ¶
func (t *MemoryTransport) AcceptStream() <-chan *transport.StreamDelegate
func (*MemoryTransport) DialStream ¶
func (t *MemoryTransport) DialStream(ctx context.Context, peer *protocol.Node, kind protocol.Stream_Type) (net.Conn, error)
func (*MemoryTransport) Identity ¶
func (t *MemoryTransport) Identity() *protocol.Node
func (*MemoryTransport) ListConnected ¶
func (t *MemoryTransport) ListConnected() []transport.ConnectedPeer
func (*MemoryTransport) ReceiveDatagram ¶
func (t *MemoryTransport) ReceiveDatagram() <-chan *transport.DatagramDelegate
func (*MemoryTransport) SendDatagram ¶
func (t *MemoryTransport) SendDatagram(_ *protocol.Node, _ []byte) error
func (*MemoryTransport) SupportDatagram ¶
func (t *MemoryTransport) SupportDatagram() bool
func (*MemoryTransport) WithCertificate ¶
func (t *MemoryTransport) WithCertificate(cert *x509.Certificate)
func (*MemoryTransport) WithClientCertificate ¶
func (t *MemoryTransport) WithClientCertificate(cert tls.Certificate) error
type PKIClient ¶
func (*PKIClient) RequestCertificate ¶
func (p *PKIClient) RequestCertificate(ctx context.Context, req *protocol.CertificateRequest) (*protocol.CertificateResponse, error)
type Transport ¶
func (*Transport) AcceptStream ¶
func (t *Transport) AcceptStream() <-chan *transport.StreamDelegate
func (*Transport) DialStream ¶
func (*Transport) ListConnected ¶
func (t *Transport) ListConnected() []transport.ConnectedPeer
func (*Transport) ReceiveDatagram ¶
func (t *Transport) ReceiveDatagram() <-chan *transport.DatagramDelegate
func (*Transport) SupportDatagram ¶
func (*Transport) TransportDestroyed ¶
func (*Transport) TransportEstablished ¶
type TunnelServer ¶
func (*TunnelServer) DialClient ¶
func (*TunnelServer) DialInternal ¶
func (*TunnelServer) Identity ¶
func (m *TunnelServer) Identity() *protocol.Node
type TunnelService ¶
func (*TunnelService) AcmeInstruction ¶
func (t *TunnelService) AcmeInstruction(ctx context.Context, req *protocol.InstructionRequest) (*protocol.InstructionResponse, error)
func (*TunnelService) AcmeValidate ¶
func (t *TunnelService) AcmeValidate(ctx context.Context, req *protocol.ValidateRequest) (*protocol.ValidateResponse, error)
func (*TunnelService) GenerateHostname ¶
func (t *TunnelService) GenerateHostname(ctx context.Context, req *protocol.GenerateHostnameRequest) (*protocol.GenerateHostnameResponse, error)
func (*TunnelService) GetNodes ¶
func (t *TunnelService) GetNodes(ctx context.Context, req *protocol.GetNodesRequest) (*protocol.GetNodesResponse, error)
func (*TunnelService) Ping ¶
func (t *TunnelService) Ping(ctx context.Context, req *protocol.ClientPingRequest) (*protocol.ClientPingResponse, error)
func (*TunnelService) PublishTunnel ¶
func (t *TunnelService) PublishTunnel(ctx context.Context, req *protocol.PublishTunnelRequest) (*protocol.PublishTunnelResponse, error)
func (*TunnelService) RegisterIdentity ¶
func (t *TunnelService) RegisterIdentity(ctx context.Context, req *protocol.RegisterIdentityRequest) (*protocol.RegisterIdentityResponse, error)
func (*TunnelService) RegisteredHostnames ¶
func (t *TunnelService) RegisteredHostnames(ctx context.Context, req *protocol.RegisteredHostnamesRequest) (*protocol.RegisteredHostnamesResponse, error)
func (*TunnelService) ReleaseTunnel ¶
func (t *TunnelService) ReleaseTunnel(ctx context.Context, req *protocol.ReleaseTunnelRequest) (*protocol.ReleaseTunnelResponse, error)
func (*TunnelService) UnpublishTunnel ¶
func (t *TunnelService) UnpublishTunnel(ctx context.Context, req *protocol.UnpublishTunnelRequest) (*protocol.UnpublishTunnelResponse, error)
type VNode ¶
func (*VNode) PrefixAppend ¶
func (*VNode) PrefixContains ¶
func (*VNode) PrefixList ¶
func (*VNode) PrefixRemove ¶
func (*VNode) RequestToJoin ¶
Click to show internal directories.
Click to hide internal directories.