server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpServer

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

HttpServer is Motion API the HTTP server.

func NewHttpServer

func NewHttpServer(store blob.Store, o ...Option) (*HttpServer, error)

NewHttpServer instantiates a new HTTP server that stores and retrieves blobs via the given store. See Option.

func (*HttpServer) ServeMux

func (m *HttpServer) ServeMux() *http.ServeMux

ServeMux returns a new HTTP handler for the endpoints supported by the server.

func (*HttpServer) Shutdown

func (m *HttpServer) Shutdown(ctx context.Context) error

Shutdown shuts down the HTTP Server.

func (*HttpServer) Start

func (m *HttpServer) Start(_ context.Context) error

Start Starts the HTTP server. See Shutdown.

type Option

type Option func(*options) error

Option is a configurable parameter in HttpServer.

func WithHttpListenAddr

func WithHttpListenAddr(addr string) Option

WithHttpListenAddr sets the HTTP server listen address. Defaults to 0.0.0.0:40080 if unspecified.

func WithMaxBlobLength

func WithMaxBlobLength(l uint64) Option

WithMaxBlobLength sets the maximum blob length accepted by the HTTP blob upload API. Defaults to 31 GiB.

Jump to

Keyboard shortcuts

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