grpc

package
v0.0.0-...-eb64f0e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Target returns the RPC server address.
	Target() string
	// Conn returns the client connection to an RPC server.
	Conn() *gorpc.ClientConn
	// Options returns a list of DialOption.
	Options() []gorpc.DialOption
	// Stop tears down the ClientConn and all underlying connections.
	Stop()
}

Client defines an interface representing a gRPC-based client.

func NewClientToTarget

func NewClientToTarget(target string) (Client, error)

NewClientToTarget creates a new Client based on a target server address.

type KeepaliveOptions

type KeepaliveOptions struct {
	ClientKeepaliveTime    int
	ClientKeepaliveTimeout int
	ServerKeepaliveTime    int
	ServerKeepaliveTimeout int
}

KeepaliveOptions is the options for set the gRPC servers or clients.

type Server

type Server interface {
	// Address returns the listener address
	Address() string
	// Server returns the underlying grpc.Server instance
	Server() *gorpc.Server
	// Listener returns the underlying net.Listener instance
	Listener() net.Listener
	// Start the underlying grpc.Server
	Start() error
	// Stop the underlying grpc.Server
	Stop()
}

Server defines an interface representing a GRPC-based server.

func NewServerFromAddress

func NewServerFromAddress(addr string) (Server, error)

NewServerFromAddress creates a new server listening on address.

func NewServerFromListener

func NewServerFromListener(listener net.Listener) (Server, error)

NewServerFromListener creates a new server based on a listener.

Directories

Path Synopsis
example
greeter
Package greeter is a generated protocol buffer package.
Package greeter is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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