server

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 19 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 added in v0.1.4

type Options struct {
	Port    int
	Swagger 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) (err 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.

Jump to

Keyboard shortcuts

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