grpc

package
v0.13.2-gc72711f Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 200 * time.Millisecond
)

Variables

This section is empty.

Functions

func NewGrpcServer

func NewGrpcServer(cfg *Config) (*grpc.Server, error)

NewGrpcServer creates a new gRPC cmd to handle incoming events and other API calls. The `Config` can be used to configure the backing store, a timeout and the logger.

func ParseCAFile

func ParseCAFile(caFile string) (*x509.CertPool, error)

func SetupTLSConfig

func SetupTLSConfig(cfg *Config) (*tls.Config, error)

TODO: move to its own grpc_tls.go file in this package.

Types

type Config

type Config struct {
	EventsChannel chan<- protos.EventRequest
	Store         storage.StoreManager
	Logger        *logging.Log
	Timeout       time.Duration
	ServerAddress string
	TlsEnabled    bool
	TlsCerts      string
	TlsMutual     bool
}

Jump to

Keyboard shortcuts

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