factory

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(r Registrator, setters ...Option) (err error)

Listen configures TLS for mutual authtentication by loading the CA into a CertPool and configuring the server's policy for TLS Client Authentication. Once TLS is configured, the gRPC options are built to make use of the TLS configuration and the receiver (Server) is registered to the gRPC server. Finally the gRPC server is started.

Types

type Option

type Option func(*Options)

Option is the functional option func.

func Config

func Config(o *tls.Config) Option

Config sets the listen port of the server.

func Port

func Port(o int) Option

Port sets the listen port of the server.

func ServerOptions

func ServerOptions(o ...grpc.ServerOption) Option

ServerOptions sets the listen port of the server.

type Options

type Options struct {
	Port          int
	Config        *tls.Config
	ServerOptions []grpc.ServerOption
}

Options is the functional options struct.

func NewDefaultOptions

func NewDefaultOptions(setters ...Option) *Options

NewDefaultOptions initializes the Options struct with default values.

type Registrator

type Registrator interface {
	Register(*grpc.Server)
}

Registrator describes the set of methods required in order for a concrete type to be used with the Listen function.

Jump to

Keyboard shortcuts

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