grpc

package module
v0.0.0-...-b897539 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package grpc implements a gRPC server for controlling our HTTP load balancer.

Index

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.

func (*Server) Start

func (s *Server) Start() error

Start starts the server and blocks.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server.

Jump to

Keyboard shortcuts

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