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 opmetrics.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 ¶
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 opmetrics.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 ¶ added in v0.10.5
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 ¶ added in v0.10.5
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.