server

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Overview

Package server handles satisfying the api.RSCAServer interface for the gRPC connection from the clients.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownMessageType = errors.New("unknown message type")

ErrUnknownMessageType is returned when a message is of unknown type.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a api.RSCAServer for co-ordinating streams from clients.

func NewServer

func NewServer(logger *zap.Logger, st state.State) *Server

NewServer returns a prepared server object.

func (*Server) ListHosts

func (s *Server) ListHosts(_ *api.Empty, stream api.Admin_ListHostsServer) error

ListHosts returns a list of hosts currently registered with the server.

func (*Server) Pipe

func (s *Server) Pipe(stream api.RSCA_PipeServer) error

Pipe handles incoming streams and maintains the stream map.

func (*Server) RemoveHost added in v0.5.9

RemoveHost removes a specified list of hosts from the server.

func (*Server) Run

func (s *Server) Run(ctx context.Context, cfg config.Conf) func() error

Run is the background runner for the server.

func (*Server) Send

func (s *Server) Send(msg *api.Message) error

Send sends a supplied message to the clients specified in the api.Message:Recipients.

func (*Server) TriggerAll

func (s *Server) TriggerAll(_ context.Context, m *api.Members) (*api.TriggerAllResponse, error)

TriggerAll triggers all the services on a matching host.

func (*Server) TriggerInfo added in v0.5.0

func (s *Server) TriggerInfo(_ context.Context, m *api.Members) (*api.TriggerInfoResponse, error)

TriggerInfo triggers an information update from the host (repeat-registration).

Jump to

Keyboard shortcuts

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