transport

package
v0.0.0-...-30cbb4e Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	DoJoin(in, targetServer *go_sheep.Node) (state *go_sheep.State, err error)
	DoPing(s *go_sheep.State, a string) (state *go_sheep.State, err error)
	DoIndirectPing(s *go_sheep.State, delegatedNodes []*go_sheep.Node, t *go_sheep.Node) (states []*go_sheep.State, err error)
}

type GRPCClient

type GRPCClient struct {
	Client
	// contains filtered or unexported fields
}

func (*GRPCClient) DoIndirectPing

func (g *GRPCClient) DoIndirectPing(s *go_sheep.State, delegatedNodes []*go_sheep.Node, t *go_sheep.Node) (states []*go_sheep.State, err error)

func (*GRPCClient) DoJoin

func (g *GRPCClient) DoJoin(in, targetServer *go_sheep.Node) (state *go_sheep.State, err error)

func (*GRPCClient) DoPing

func (g *GRPCClient) DoPing(s *go_sheep.State, a string) (state *go_sheep.State, err error)

type GRPCServer

type GRPCServer struct {
	Server
	// contains filtered or unexported fields
}

func (*GRPCServer) DelegateCheck

func (g *GRPCServer) DelegateCheck(_ context.Context, req *go_sheep.DelegateCheckRequest) (*go_sheep.State, error)

func (*GRPCServer) Join

func (g *GRPCServer) Join(_ context.Context, n *go_sheep.Node) (*go_sheep.State, error)

func (*GRPCServer) Ping

func (g *GRPCServer) Ping(_ context.Context, s *go_sheep.State) (*go_sheep.State, error)

func (*GRPCServer) Serve

func (g *GRPCServer) Serve(address string, quit chan struct{}, logger zap.Logger) error

func (*GRPCServer) ServeIndirectCheck

func (g *GRPCServer) ServeIndirectCheck(*go_sheep.DelegateCheckRequest) (*go_sheep.State, error)

func (*GRPCServer) ServeJoin

func (g *GRPCServer) ServeJoin(n *go_sheep.Node) (*go_sheep.State, error)

func (*GRPCServer) ServePing

func (g *GRPCServer) ServePing(s *go_sheep.State) (*go_sheep.State, error)

type GRPCTransport

type GRPCTransport struct {
	GRPCServer
	GRPCClient
	go_sheep.SWIM
}

func NewGRPCTransport

func NewGRPCTransport(l zap.Logger) *GRPCTransport

type Server

type Server interface {
	ServeJoin(*go_sheep.Node) (*go_sheep.State, error)
	ServePing(*go_sheep.State) (*go_sheep.State, error)
	ServeIndirectCheck(*go_sheep.DelegateCheckRequest) (*go_sheep.State, error)
	Serve(string, chan struct{}, zap.Logger) error
}

type Transporter

type Transporter interface {
	Client
	Server
	go_sheep.SWIM
}

func New

func New(t Type, l zap.Logger) Transporter

type Type

type Type string
const (
	GRPC Type = "GRPC"
	REST Type = "REST"
)

Jump to

Keyboard shortcuts

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