server

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveFragment

func RemoveFragment(path string) string

RemoveFragment - clear url from reference in path

func RemoveTrailingSlash

func RemoveTrailingSlash(path string) string

RemoveTrailingSlash returns path without trailing slash

Types

type Handlers

type Handlers struct {
	API    api.API
	Logger *logger.Logger
}

Handlers -.

func NewHandlers

func NewHandlers(api api.API, l *logger.Logger) Handlers

NewHandlers returns a new instance of Handlers

func (Handlers) Get

func (h Handlers) Get(path, method string, body io.ReadCloser) (api.Response, bool, error)

Get -.

type Server

type Server struct {
	Config   config.Server
	Server   *http.Server
	Logger   *logger.Logger
	Handlers Handlers
}

Server is struct for Server

func NewServer

func NewServer(config config.Server, l *logger.Logger, h Handlers) *Server

NewServer returns a new instance of Server instance

func (*Server) Handler

func (s *Server) Handler(w http.ResponseWriter, r *http.Request)

Handler -.

func (*Server) Run

func (s *Server) Run() error

Run -.

func (*Server) Stop

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

Jump to

Keyboard shortcuts

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