broadcast

package
v0.0.4-RC1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

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.

func (*Server) SetState

func (s *Server) SetState(st stateInterface)

SetState is the state setter.

func (*Server) Start

func (s *Server) Start()

Start sets up the server to process requests.

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server.

type ServerConfig

type ServerConfig struct {
	Host string `mapstructure:"Host"`
	Port int    `mapstructure:"Port"`
}

ServerConfig represents the configuration of the broadcast server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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