Documentation ¶
Index ¶
- Constants
- func CLIFlags(envPrefix string) []cli.Flag
- type CLIConfig
- type HealthzResponse
- type Middleware
- type Server
- type ServerOption
- func WithAPIs(apis []rpc.API) ServerOption
- func WithCORSHosts(hosts []string) ServerOption
- func WithHTTPRecorder(recorder kmetrics.HTTPRecorder) ServerOption
- func WithHealthzHandler(hdlr http.Handler) ServerOption
- func WithHealthzPath(path string) ServerOption
- func WithJWTSecret(secret []byte) ServerOption
- func WithLogger(lgr log.Logger) ServerOption
- func WithMiddleware(middleware func(http.Handler) (hdlr http.Handler)) ServerOption
- func WithRPCPath(path string) ServerOption
- func WithTLSConfig(tls *ServerTLSConfig) ServerOption
- func WithVHosts(hosts []string) ServerOption
- type ServerTLSConfig
Constants ¶
View Source
const ( ListenAddrFlagName = "rpc.addr" PortFlagName = "rpc.port" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIConfig ¶
func ReadCLIConfig ¶
func ReadCLIConfig(ctx *cli.Context) CLIConfig
type HealthzResponse ¶
type HealthzResponse struct {
Version string `json:"version"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
type ServerOption ¶
type ServerOption func(b *Server)
func WithAPIs ¶
func WithAPIs(apis []rpc.API) ServerOption
func WithCORSHosts ¶
func WithCORSHosts(hosts []string) ServerOption
func WithHTTPRecorder ¶
func WithHTTPRecorder(recorder kmetrics.HTTPRecorder) ServerOption
func WithHealthzHandler ¶
func WithHealthzHandler(hdlr http.Handler) ServerOption
func WithHealthzPath ¶
func WithHealthzPath(path string) ServerOption
func WithJWTSecret ¶
func WithJWTSecret(secret []byte) ServerOption
func WithLogger ¶
func WithLogger(lgr log.Logger) ServerOption
func WithMiddleware ¶
func WithMiddleware(middleware func(http.Handler) (hdlr http.Handler)) ServerOption
WithMiddleware adds an http.Handler to the rpc server handler stack The added middleware is invoked directly before the RPC callback
func WithRPCPath ¶
func WithRPCPath(path string) ServerOption
func WithTLSConfig ¶
func WithTLSConfig(tls *ServerTLSConfig) ServerOption
WithTLSConfig configures TLS for the RPC server If this option is passed, the server will use ListenAndServeTLS
func WithVHosts ¶
func WithVHosts(hosts []string) ServerOption
Click to show internal directories.
Click to hide internal directories.