grpc

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package grpc is a layer for interacting with gRPC protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(config ConnConfig) (*grpc.ClientConn, error)

Types

type ConnConfig

type ConnConfig struct {
	Host string `envconfig:"GRPC_HOST" default:"localhost"`
	Port string `envconfig:"GRPC_PORT" default:"8000"`
}

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config ServerConfig, ratelimiter ratelimit.Limiter) (*Server, error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

type ServerConfig

type ServerConfig struct {
	Host string `envconfig:"GRPC_HOST" default:"0.0.0.0"`
	Port string `envconfig:"GRPC_PORT" default:"8000"`
	RPS  int    `envconfig:"RPS"`
}

Jump to

Keyboard shortcuts

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