Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

server

v0.1.8
github.com/takama/grpc/pkg/server

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

14 matches

Top ↑

Functions

Options

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

Options gives options that manage server connection parameters.

Types

Certificates

type Certificates struct {
	Crt string
	Key string
}

Certificates contains path to certificates and key.

Config

type Config struct {
	Port       int
	Gateway    Gateway
	Connection Connection
}

Config contains params to setup server.

Connection

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

Connection parameters.

Gateway

type Gateway struct {
	Port int
}

Gateway contains params to setup gateway.

Keepalive

type Keepalive struct {
	Time    int
	Timeout int
}

Keepalive connection parameters.

Server

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

Server contains core functionality of the service.

New

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

New creates a new core server.

Server.LivenessProbe

func (s Server) LivenessProbe() error

LivenessProbe returns liveness probe of the server.

Server.ReadinessProbe

func (s Server) ReadinessProbe() error

ReadinessProbe returns readiness probe for the server.

Server.Run

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

Run starts the server.

Server.Shutdown

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

Shutdown process graceful shutdown for the server.

Dependency graph