service

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPingTimeout           = 6 * time.Second
	DefaultMaxMissingPingCounter = 3
)
View Source
const GRPCDefinitionVersion = "2.0.0"
View Source
const GRPCGracefulStopTimeout = 10 * time.Second

Variables

View Source
var (
	RequestedKillError = errors.New("kill requested")
)

Functions

func StartCollectorGRPC

func StartCollectorGRPC(ctx context.Context, srv Server, proxy CollectorProxy, grpcLn net.Listener, pingTimeout time.Duration, pingMaxMissedCount uint, collectChunkSize uint64)

func StartPublisherGRPC

func StartPublisherGRPC(ctx context.Context, srv Server, proxy PublisherProxy, grpcLn net.Listener, pingTimeout time.Duration, pingMaxMissedCount uint)

Types

type Channel

type Channel struct {
	*inprocgrpc.Channel
}

func NewChannel

func NewChannel() *Channel

func (*Channel) GracefulStop

func (c *Channel) GracefulStop()

func (*Channel) Serve

func (*Channel) Serve(_ net.Listener) error

func (*Channel) Stop

func (c *Channel) Stop()

type CollectorProxy

type CollectorProxy interface {
	RequestCollect(id string) <-chan types.CollectChunk
	LoadTask(id string, rawConfig []byte, mtsSelectors []string) error
	UnloadTask(id string) error
	CustomInfo(id string) ([]byte, error)
}

type PublisherProxy

type PublisherProxy interface {
	RequestPublish(id string, mts []*types.Metric) types.ProcessingStatus
	LoadTask(id string, config []byte) error
	UnloadTask(id string) error
	CustomInfo(id string) ([]byte, error)
}

type Server

type Server interface {
	grpchan.ServiceRegistry

	// For compatibility with the native grpc.Server
	Serve(lis net.Listener) error
	GracefulStop()
	Stop()
}

func NewGRPCServer

func NewGRPCServer(ctx context.Context, opt *plugin.Options) (Server, error)

An abstraction providing a unified interface for

  • the native go-grpc implementation
  • https://github.com/solarwinds/grpchan - this one provides a way of using gRPC with a custom transport (that means sth other than the native h2 - HTTP1.1 or inprocess/channels are available out of the box)

Jump to

Keyboard shortcuts

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