route

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunOption

type RunOption func(*RunOptions)

RunOption is an option of Server.Run().

func WithGracefullContext

func WithGracefullContext(ctx context.Context) RunOption

WithGracefullContext accepts a context to shutdown a Server with care for existing client connections.

type RunOptions

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

RunOptions holds a set of configurations for Server.Run().

type Server

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

Server provides a webtty HTTP endpoint.

func New

func New(containerCli container.Cli, options config.ServerConfig) (*Server, error)

New creates a new instance of Server. Server will use the New() of the factory provided to handle each request.

func (*Server) Run

func (server *Server) Run(ctx context.Context, options ...RunOption) error

Run starts the main process of the Server. The cancelation of ctx will shutdown the server immediately with aborting existing connections. Use WithGracefulContext() to support graceful shutdown.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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