Documentation ¶
Index ¶
- type Proxy
- type Server
- func (s *Server) AddClient(ctx context.Context, req *pb.AddClientRequest) (*pb.AddClientResponse, error)
- func (s *Server) Connect(req *pb.ConnectRequest, stream pb.Stela_ConnectServer) error
- func (s *Server) Deregister(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)
- func (s *Server) Discover(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)
- func (s *Server) DiscoverAll(ctx context.Context, req *pb.DiscoverAllRequest) (*pb.DiscoverResponse, error)
- func (s *Server) DiscoverOne(ctx context.Context, req *pb.DiscoverRequest) (*pb.ServiceMessage, error)
- func (s *Server) DiscoverRegex(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)
- func (s *Server) InstanceDiscover(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)
- func (s *Server) InstanceDiscoverAll(ctx context.Context, req *pb.DiscoverAllRequest) (*pb.DiscoverResponse, error)
- func (s *Server) InstanceDiscoverOne(ctx context.Context, req *pb.DiscoverRequest) (*pb.ServiceMessage, error)
- func (s *Server) InstanceDiscoverRegex(ctx context.Context, req *pb.DiscoverRequest) (*pb.DiscoverResponse, error)
- func (s *Server) NotifyClients(ctx context.Context, req *pb.ServiceMessage) (*pb.NotifyResponse, error)
- func (s *Server) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)
- func (s *Server) SetPeers(peers []*node.Node)
- func (s *Server) Subscribe(ctx context.Context, req *pb.SubscribeRequest) (*pb.SubscribeResponse, error)
- func (s *Server) Unsubscribe(ctx context.Context, req *pb.SubscribeRequest) (*pb.SubscribeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) 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.