Documentation ¶
Index ¶
- Constants
- type Handler
- type HandlerOption
- func HandlerWithCallTimeout(callTimeout time.Duration) HandlerOption
- func HandlerWithConnectTimeout(connectTimeout time.Duration) HandlerOption
- func HandlerWithHeader(key string, value string) HandlerOption
- func HandlerWithKeepaliveTime(keepaliveTime time.Duration) HandlerOption
- func HandlerWithLogger(logger *zap.Logger) HandlerOption
Constants ¶
const ( // DefaultCallTimeout is the default call timeout. DefaultCallTimeout = 60 * time.Second // DefaultConnectTimeout is the default connect timeout. DefaultConnectTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
Invoke(fileDescriptorSets []*descriptor.FileDescriptorSet, address string, method string, inputReader io.Reader, outputWriter io.Writer) error
}
Handler handles gRPC calls.
func NewHandler ¶
func NewHandler(options ...HandlerOption) Handler
NewHandler returns a new Handler.
type HandlerOption ¶
type HandlerOption func(*handler)
HandlerOption is an option for a new Handler.
func HandlerWithCallTimeout ¶
func HandlerWithCallTimeout(callTimeout time.Duration) HandlerOption
HandlerWithCallTimeout returns a HandlerOption that has the given call timeout.
Each invocation must be completed within this time.
The default is to use DefaultCallTimeout.
func HandlerWithConnectTimeout ¶
func HandlerWithConnectTimeout(connectTimeout time.Duration) HandlerOption
HandlerWithConnectTimeout returns a HandlerOption that has the given connect timeout.
The default is to use DefaultConnectTimeout.
func HandlerWithHeader ¶
func HandlerWithHeader(key string, value string) HandlerOption
HandlerWithHeader returns a HandlerOption that adds the given key/value header.
func HandlerWithKeepaliveTime ¶
func HandlerWithKeepaliveTime(keepaliveTime time.Duration) HandlerOption
HandlerWithKeepaliveTime returns a HandlerOption that has the given keepalive time.
The default is to have no keepalive time.
func HandlerWithLogger ¶
func HandlerWithLogger(logger *zap.Logger) HandlerOption
HandlerWithLogger returns a HandlerOption that uses the given logger.
The default is to use zap.NewNop().