httpserver

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// BuildVersion contains the version of the Orb build.
	BuildVersion string
)

Functions

This section is empty.

Types

type Opt added in v1.0.0

type Opt func(*options)

Opt is an HTTP server option.

func WithCertFile added in v1.0.0

func WithCertFile(value string) Opt

WithCertFile sets the TLS certificate file.

func WithHandlers added in v1.0.0

func WithHandlers(handlers ...common.HTTPHandler) Opt

WithHandlers adds HTTP request handlers.

func WithKeyFile added in v1.0.0

func WithKeyFile(value string) Opt

WithKeyFile sets the TLS key file.

func WithServerIdleTimeout added in v1.0.0

func WithServerIdleTimeout(value time.Duration) Opt

WithServerIdleTimeout sets the idle timeout.

func WithServerReadHeaderTimeout added in v1.0.0

func WithServerReadHeaderTimeout(value time.Duration) Opt

WithServerReadHeaderTimeout sets the read header timeout.

func WithTracingEnabled added in v1.0.0

func WithTracingEnabled(enable bool) Opt

WithTracingEnabled enables/disables OpenTelemetry tracing.

func WithTracingServiceName added in v1.0.0

func WithTracingServiceName(serviceName string) Opt

WithTracingServiceName sets the name of the OpenTelemetry service.

type Server

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

Server implements an HTTP server.

func New

func New(url string, opts ...Opt) *Server

New returns a new HTTP server.

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server in a separate Go routine.

func (*Server) Stop

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

Stop stops the REST service.

Directories

Path Synopsis
signature/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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