rest

package
v0.0.0-...-78289ef Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncreaseRestRequests

func IncreaseRestRequests(method string)

func ObserveRestRequestsTime

func ObserveRestRequestsTime(method string, timing float64)

func RegisterCustomMetrics

func RegisterCustomMetrics()

func RestHostDefault

func RestHostDefault() string

func RestPortDefault

func RestPortDefault() int

Types

type Config

type Config struct {
	RestHost string
	RestPort int
}

func LoadConfig

func LoadConfig() *Config

type Server

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

func New

func New(cfg *Config, db database.InMemoryDb) *Server

func (*Server) CreateProduct

func (s *Server) CreateProduct(writer http.ResponseWriter, request *http.Request)

func (*Server) DeleteProduct

func (s *Server) DeleteProduct(writer http.ResponseWriter, request *http.Request)

func (*Server) GetProduct

func (s *Server) GetProduct(writer http.ResponseWriter, request *http.Request)

func (*Server) GetProducts

func (s *Server) GetProducts(writer http.ResponseWriter, request *http.Request)

func (*Server) Running

func (s *Server) Running() bool

func (*Server) Shutdown

func (s *Server) Shutdown(timeout int)

func (*Server) Start

func (s *Server) Start() error

func (*Server) UpdateProduct

func (s *Server) UpdateProduct(writer http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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