grpc

package
v0.2011.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package grpc implements a gRPC sentry worker.

Index

Constants

View Source
const (
	// CfgEnabled enables the sentry grpc worker.
	CfgEnabled = "worker.sentry.grpc.enabled"

	// CfgUpstreamAddress is the grpc address of the upstream node.
	CfgUpstreamAddress = "worker.sentry.grpc.upstream.address"
	// CfgUpstreamID is the node ID of the upstream node.
	CfgUpstreamID = "worker.sentry.grpc.upstream.id"

	// CfgClientAddresses are addresses on which the gRPC endpoint is reachable.
	CfgClientAddresses = "worker.sentry.grpc.client.address"
	// CfgClientPort is the sentry node's client port.
	CfgClientPort = "worker.sentry.grpc.client.port"
)

Variables

Flags has the configuration flags.

Functions

func GetNodeAddresses

func GetNodeAddresses() ([]node.Address, error)

GetNodeAddresses returns configured sentry node addresses.

Types

type Worker

type Worker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Worker is a gRPC sentry node worker proxying gRPC requests to upstream node.

func New

func New(backend sentry.LocalBackend, identity *identity.Identity) (*Worker, error)

New creates a new sentry grpc worker.

func (*Worker) Cleanup

func (g *Worker) Cleanup()

Cleanup performs the service specific post-termination cleanup.

func (*Worker) Initialized

func (g *Worker) Initialized() <-chan struct{}

Initialized returns a channel that will be closed when the worker initializes.

func (*Worker) Name

func (g *Worker) Name() string

Name returns the service name.

func (*Worker) Quit

func (g *Worker) Quit() <-chan struct{}

Quit returns a channel that will be closed when the service terminates.

func (*Worker) Start

func (g *Worker) Start() error

Start starts the worker.

func (*Worker) Stop

func (g *Worker) Stop()

Stop halts the worker.

Jump to

Keyboard shortcuts

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