Discover Packages
github.com/powerman/go-monolith-example
pkg
serve
package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Oct 21, 2020
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Overview
Index
Constants
Variables
Functions
HTTP(ctx, addr, handler, service)
Metrics(ctx, addr, reg)
RPC(ctx, addr, rcvr)
RPCName(ctx, addr, rcvr, name)
Types
Source Files
Documentation
Documentation
¶
Package serve provides helpers to start and shutdown network services.
func HTTP(ctx Ctx, addr netx.Addr, handler http.Handler, service string) error
func Metrics(ctx Ctx, addr netx.Addr, reg *prometheus.Registry) error
func RPC(ctx Ctx, addr netx.Addr, rcvr interface{}) error
func RPCName(ctx Ctx, addr netx.Addr, rcvr interface{}, name string) (err error)
type Ctx
HTTP starts HTTP server on addr using handler logged as service.
It runs until failed or ctx.Done.
Metrics starts HTTP server on addr path /metrics using reg as
prometheus handler.
RPC starts HTTP server on addr path /rpc using rcvr as JSON-RPC 2.0
handler.
RPCName starts HTTP server on addr path /rpc using rcvr as JSON-RPC 2.0
handler but uses the provided name for the type instead of the
receiver's concrete type.
Ctx is a synonym for convenience.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.