rpc

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 16 Imported by: 33

Documentation

Index

Constants

View Source
const (
	ListenAddrFlagName = "rpc.addr"
	PortFlagName       = "rpc.port"
)

Variables

This section is empty.

Functions

func CLIFlags

func CLIFlags(envPrefix string) []cli.Flag

Types

type CLIConfig

type CLIConfig struct {
	ListenAddr string
	ListenPort int
}

func ReadCLIConfig

func ReadCLIConfig(ctx *cli.Context) CLIConfig

func (CLIConfig) Check

func (c CLIConfig) Check() error

type HealthzResponse

type HealthzResponse struct {
	Version string `json:"version"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(host string, port int, appVersion string, opts ...ServerOption) *Server

func (*Server) AddAPI

func (b *Server) AddAPI(api rpc.API)

func (*Server) Endpoint

func (b *Server) Endpoint() string

func (*Server) Start

func (b *Server) Start() error

func (*Server) Stop

func (b *Server) Stop() error

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 WithRPCPath

func WithRPCPath(path string) ServerOption

func WithVHosts

func WithVHosts(hosts []string) ServerOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL