server

package
v0.0.0-...-74c00de Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, reg Register, cfg *Config, customOpts ...grpc.ServerOption) error

Run run gRPC server ctx context to controll server stop impl your grpc server implemention cfg configuration of server customOpts custom options passing to gRPC server

Types

type Config

type Config struct {
	Host        string `toml:"host"`
	Port        int    `toml:"port"`
	TLS         bool   `toml:"tls_on"`
	CertFile    string `toml:"cert_file"`
	KeyFile     string `toml:"key_file"`
	CatchSignal bool   `toml:"catch_signal"`
}

Config config of gRPC seaver

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig get a default config

type Register

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

Register interface definition of gRPC service implemention

Jump to

Keyboard shortcuts

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