rhttp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPClient

func GetHTTPClient(ctx context.Context) *http.Client

GetHTTPClient returns an http client with open census tracing support. TODO(labkode): harden it. https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779

func NewRequest

func NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)

NewRequest creates an HTTP request that sets the token if it is passed in ctx.

Types

type Server

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

Server contains the server info.

func New

func New(m interface{}, l zerolog.Logger) (*Server, error)

New returns a new server

func (*Server) Address

func (s *Server) Address() string

Address returns the network address.

func (*Server) GracefulStop

func (s *Server) GracefulStop() error

GracefulStop gracefully stops the server.

func (*Server) Network

func (s *Server) Network() string

Network return the network type.

func (*Server) Start

func (s *Server) Start(ln net.Listener) error

Start starts the server

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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