Documentation ¶
Overview ¶
Package grpc implements a gRPC server for controlling our HTTP load balancer.
Index ¶
- type Server
- func (s *Server) AddBackend(ctx context.Context, req *pb.AddBackendReq) (*pb.AddBackendResp, error)
- func (s *Server) AddPool(ctx context.Context, req *pb.AddPoolReq) (*pb.AddPoolResp, error)
- func (s *Server) PoolHealth(ctx context.Context, req *pb.PoolHealthReq) (*pb.PoolHealthResp, error)
- func (s *Server) RemoveBackend(ctx context.Context, req *pb.RemoveBackendReq) (*pb.RemoveBackendResp, error)
- func (s *Server) RemovePool(ctx context.Context, req *pb.RemovePoolReq) (*pb.RemovePoolResp, error)
- func (s *Server) Start() error
- func (s *Server) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { pb.UnimplementedLoadBalancerServer // contains filtered or unexported fields }
Server is a gRPC server for interacting with the load balancer.
func New ¶
func New(addr string, lb *http.LoadBalancer) (*Server, error)
New creates a new instance of Server.
func (*Server) AddBackend ¶
func (s *Server) AddBackend(ctx context.Context, req *pb.AddBackendReq) (*pb.AddBackendResp, error)
AddBackend adds a backend as defined in req.
func (*Server) AddPool ¶
func (s *Server) AddPool(ctx context.Context, req *pb.AddPoolReq) (*pb.AddPoolResp, error)
AddPool adds a pool as defined in req.
func (*Server) PoolHealth ¶
func (s *Server) PoolHealth(ctx context.Context, req *pb.PoolHealthReq) (*pb.PoolHealthResp, error)
PoolHealth returns the health of a pool defined in req.
func (*Server) RemoveBackend ¶
func (s *Server) RemoveBackend(ctx context.Context, req *pb.RemoveBackendReq) (*pb.RemoveBackendResp, error)
RemoveBackend remoes a backend as defined in req.
func (*Server) RemovePool ¶
func (s *Server) RemovePool(ctx context.Context, req *pb.RemovePoolReq) (*pb.RemovePoolResp, error)
RemovePool removes a pool as defined in req.
Click to show internal directories.
Click to hide internal directories.