Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryCodec ¶
type BinaryCodec struct{}
BinaryCodec is a encoding.Codec that acts as an identity transform for raw binary inputs and outputs.
When marshaling, it simply returns the input byte slice. When unmarshaling, it expects a pointer to a byte slice as an input, so it can point it at the raw byte slice.
func (*BinaryCodec) Marshal ¶
func (bc *BinaryCodec) Marshal(value interface{}) ([]byte, error)
func (*BinaryCodec) Name ¶
func (bc *BinaryCodec) Name() string
func (*BinaryCodec) Unmarshal ¶
func (bc *BinaryCodec) Unmarshal(data []byte, value interface{}) error
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux serves HTTP and Websocket endpoints that re-routes
func New ¶
New creates a new Mux that loads all registered services in the gRPC server and sets up corresponding routes.
Unary requests are set up as basic HTTP/1.1 requests. Streaming requests are set up as Websocket connections.
func (*Mux) ListenAndServeHTTP ¶
ListenAndServeHTTP listens on the specified address, and forwards requests to the gRPC server.
type MuxOption ¶
type MuxOption func(*Mux)
MuxOption configures the mux.
func WithCORSEnabled ¶
WithCORSEnabled sets whether CORS is enabled.
func WithRouter ¶
WithRouter provides an alternative mux.Router to use.
func WithUpgrader ¶
WithUpgrader provides an alternative websocket.Upgrader to use.