go-api-boilerplate: github.com/vardius/go-api-boilerplate/pkg/grpc Index | Files | Directories

package grpc

import "github.com/vardius/go-api-boilerplate/pkg/grpc"

Index

Package Files

check.go connection.go server.go

func IsConnectionServing Uses

func IsConnectionServing(ctx context.Context, service string, conn *grpc.ClientConn) bool

IsConnectionServing checks if GRPC connection status equals HealthCheckResponse_SERVING

func NewConnection Uses

func NewConnection(ctx context.Context, host string, port int, cfg ConnectionConfig, logger *log.Logger) *grpc.ClientConn

NewConnection provides new grpc connection

func NewServer Uses

func NewServer(cfg ServerConfig, logger *log.Logger, unaryInterceptors []grpc.UnaryServerInterceptor, streamInterceptors []grpc.StreamServerInterceptor) *grpc.Server

NewServer provides new grpc server

type ConnectionConfig Uses

type ConnectionConfig struct {
    ConnTime    time.Duration
    ConnTimeout time.Duration
}

ConnectionConfig provides values for gRPC connection configuration

type ServerConfig Uses

type ServerConfig struct {
    ServerMinTime time.Duration
    ServerTime    time.Duration
    ServerTimeout time.Duration
}

ServerConfig provides values for gRPC server configuration

Directories

PathSynopsis
middleware
middleware/firewall

Package grpc imports 14 packages (graph) and is imported by 4 packages. Updated 2020-08-04. Refresh now. Tools for package owners.