server

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Options

func Options(cfg *Config, opts ...grpc.ServerOption) []grpc.ServerOption

Options gives options that manage server connection parameters.

Types

type Certificates

type Certificates struct {
	Crt string
	Key string
}

Certificates contains path to certificates and key.

type Config

type Config struct {
	Port       int
	Gateway    Gateway
	Connection Connection
}

Config contains params to setup server.

type Connection

type Connection struct {
	Idle      int
	Age       int
	Grace     int
	Keepalive Keepalive
}

Connection parameters.

type Gateway

type Gateway struct {
	Port int
}

Gateway contains params to setup gateway.

type Keepalive

type Keepalive struct {
	Time    int
	Timeout int
}

Keepalive connection parameters.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server contains core functionality of the service.

func New

func New(ctx context.Context, cl *client.Client, cfg *Config, log *zap.Logger) (*Server, error)

New creates a new core server.

func (Server) LivenessProbe

func (s Server) LivenessProbe() error

LivenessProbe returns liveness probe of the server.

func (Server) ReadinessProbe

func (s Server) ReadinessProbe() error

ReadinessProbe returns readiness probe for the server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the server.

func (Server) Shutdown

func (s Server) Shutdown(ctx context.Context) error

Shutdown process graceful shutdown for the server.

Jump to

Keyboard shortcuts

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