server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listeners

type Listeners struct {
	// Main handle all incoming requests.
	Main net.Listener

	// GWConn forwards HTTP requests to the gRPC server.
	GWConn *grpc.ClientConn
}

Listeners combines the API server listeners and forwarders.

func (*Listeners) Close

func (l *Listeners) Close() error

Close all underlying connections (i.e. listeners and forwarders).

type Options

type Options struct {
	Port    int
	Swagger bool
	UI      bool
}

Options to configure it once for all.

type Server

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

Server is a helper to manager an API Server.

func NewServer

func NewServer(opts Options) *Server

NewServer returns a fresh API server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run the API server in backend. It first start the listeners then proceed to launch the connection multiplexers for the gRPC server and its HTTP gateway.

func (*Server) Stop

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

Jump to

Keyboard shortcuts

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