server

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 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 Server

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

Server is a helper to manager an API Server.

func NewServer

func NewServer(opts ServerOptions) *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.

type ServerOptions

type ServerOptions struct {
	Port    int
	Swagger bool
}

ServerOptions to configure it once for all.

Jump to

Keyboard shortcuts

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