Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(ctx context.Context, serverAddress string) (pb.BroadcastServiceClient, *grpc.ClientConn, context.CancelFunc, error)
NewClient creates a grpc client to communicates with the Broadcast server
Types ¶
type Server ¶
type Server struct { pb.UnimplementedBroadcastServiceServer // contains filtered or unexported fields }
Server provides the functionality of the Broadcast service.
func NewServer ¶
func NewServer(cfg *ServerConfig, state stateInterface) *Server
NewServer is the Broadcast server constructor.
func (*Server) GetBatch ¶
func (s *Server) GetBatch(ctx context.Context, in *pb.GetBatchRequest) (*pb.GetBatchResponse, error)
GetBatch returns a batch by batch number.
func (*Server) GetLastBatch ¶
func (s *Server) GetLastBatch(ctx context.Context, empty *emptypb.Empty) (*pb.GetBatchResponse, error)
GetLastBatch returns the last batch.
type ServerConfig ¶
ServerConfig represents the configuration of the broadcast server.
Click to show internal directories.
Click to hide internal directories.