transport

package
v0.0.0-...-00593c4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	ServerName string
	CertPath   string
	KeyPath    string
	CAPath     string
}

Proxy information used to connect to stela peers

type Server

type Server struct {
	Store store.Store

	Timeout time.Duration
	Proxy   *Proxy
	// contains filtered or unexported fields
}

Server implements the stela.proto service

func (*Server) AddClient

func (s *Server) AddClient(ctx context.Context, req *pb.AddClientRequest) (*pb.AddClientResponse, error)

AddClient adds a client to the store and returns it's id

func (*Server) Connect

func (s *Server) Connect(req *pb.ConnectRequest, stream pb.Stela_ConnectServer) error

Connect a stela client to a stream of possible subscriptions. Uses the client id in to keep track of services and subscriptions it registers

func (*Server) Deregister

func (s *Server) Deregister(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)

Deregister a service

func (*Server) Discover

func (s *Server) Discover(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)

Discover all services registered under a service name. Ex. "test.services.fg"

func (*Server) DiscoverAll

func (s *Server) DiscoverAll(ctx context.Context, req *pb.DiscoverAllRequest) (*pb.DiscoverResponse, error)

DiscoverAll returns all services registered with any stela member peer

func (*Server) DiscoverOne

func (s *Server) DiscoverOne(ctx context.Context, req *pb.DiscoverRequest) (*pb.ServiceMessage, error)

DiscoverOne service registered under a service name. TODO Round Robin peers

func (*Server) DiscoverRegex

func (s *Server) DiscoverRegex(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)

DiscoverRegex all services registered under a service name. Ex. "test.services.fg"

func (*Server) InstanceDiscover

func (s *Server) InstanceDiscover(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)

InstanceDiscover all services registered under a service name. Ex. "test.services.fg"

func (*Server) InstanceDiscoverAll

func (s *Server) InstanceDiscoverAll(ctx context.Context, req *pb.DiscoverAllRequest) (*pb.DiscoverResponse, error)

InstanceDiscoverAll returns all services registered with stela even other clients TODO

func (*Server) InstanceDiscoverOne

func (s *Server) InstanceDiscoverOne(ctx context.Context, req *pb.DiscoverRequest) (*pb.ServiceMessage, error)

InstanceDiscoverOne service registered under a service name.

func (*Server) InstanceDiscoverRegex

func (s *Server) InstanceDiscoverRegex(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)

InstanceDiscoverRegex all services registered under a service name. Ex. "test.services.fg"

func (*Server) NotifyClients

func (s *Server) NotifyClients(ctx context.Context, req *pb.ServiceMessage) (*pb.NotifyResponse, error)

NotifyClients tells all locally subscribed clients about a service change

func (*Server) Register

func (s *Server) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)

Register a service to a client

func (*Server) SetPeers

func (s *Server) SetPeers(peers []*node.Node)

SetPeers sets the peers slice

func (*Server) Subscribe

func (s *Server) Subscribe(ctx context.Context, req *pb.SubscribeRequest) (*pb.SubscribeResponse, error)

Subscribe a client to a service name.

func (*Server) Unsubscribe

func (s *Server) Unsubscribe(ctx context.Context, req *pb.SubscribeRequest) (*pb.SubscribeResponse, error)

Unsubscribe a client to a service name.

Jump to

Keyboard shortcuts

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