server

package
v0.0.0-...-8da70b3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register[T any](
	s *Server,
	handler func(svc T, opts ...connect.HandlerOption) (string, http.Handler),
	svc T, opts ...connect.HandlerOption,
)

Register can be user to register a new sub-service to the server. This is _NOT_ a part of the Server API, because it is generic.

Types

type Server

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

Server exposes a set of Connect APIs over both gRPC and HTTP. Reflection is enabled.

func New

func New(
	ctx context.Context, bitcoind *coreproxy.Bitcoind,
) *Server

New creates a new Server with interceptors applied.

func (*Server) Handler

func (s *Server) Handler(ctx context.Context) http.Handler

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, address string) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

Shutdown tries to gracefully stop the server, forcing a shutdown after a timeout if this isn't possible. It is safe to call on a nil server.

Jump to

Keyboard shortcuts

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