grpcservice

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package grpcservice defines a service.Service which passes all received messages to a destination host using grpc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(cfg *spb.ServiceConfig) (service.Service, error)

Factory is a server.ServiceFactory that creates a GRPCService.

cfg must contain a fleetspeak.grpcservice.Config message describing how to dial the target grpc server.

Types

type GRPCService

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

GRPCService is a service.Service which forwards all received messages to an implementation of ggrpc.Processor.

func NewGRPCService

func NewGRPCService(c *grpc.ClientConn) *GRPCService

NewGRPCService returns a service.Service which forwards received messages to c. Implementations which wish to implement transport security or otherwise control the connection used should define a service.Factory based on this.

func (*GRPCService) ProcessMessage

func (s *GRPCService) ProcessMessage(ctx context.Context, m *fspb.Message) error

func (*GRPCService) Start

func (s *GRPCService) Start(sctx service.Context) error

func (*GRPCService) Stop

func (s *GRPCService) Stop() error

func (*GRPCService) Update

func (s *GRPCService) Update(c *grpc.ClientConn)

Update replaces the current connection with the given one, may be nil to indicate that a connection is currently unavailable.

Directories

Path Synopsis
client
testing
Package main tests a fleetspeak server talking through a grpcserver to a python loopback process.
Package main tests a fleetspeak server talking through a grpcserver to a python loopback process.
proto

Jump to

Keyboard shortcuts

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