rest

package
v0.0.0-...-15ef477 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(url *url.URL, verifyByFingerprint *crypto.VerifyByFingerprint) model.Drop

NewClient creates a new client for the given base URL. When verifyByFingerprint is set, regular certificate validation is disabled for TLS connections. Instead, the client expects a certificate (may be self-signed) for a public key with the given fingerprint configuration.

Types

type Server

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

func NewServer

func NewServer(addr string, tls TLS, drop model.Drop) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) StartServing

func (s *Server) StartServing() (err error)

type TLS

type TLS interface {
	// Config provides the tls.Config object to be set on server.TLSConfig
	Config() (*tls.Config, error)
	// ListenAndServe encapsulates the decision, whether server.ListenAndServe() or server.ListenAndServeTLS() should
	// be invoked.
	ListenAndServe(*http.Server) error
}

TLS abstracts the way REST interfaces TLS is configured.

func NewFileBasedTLS

func NewFileBasedTLS(keyFile string, certFile string) TLS

func NoTLS

func NoTLS() TLS

Jump to

Keyboard shortcuts

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