http

package
v0.0.0-...-6151759 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: GPL-2.0, GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken interface {
	Create(*lara.User) (string, error)
	Parse(token string) (*lara.User, error)
}

AuthToken is authentication token provider/validator

type Server

type Server struct {

	// Services
	OwnerService   lara.OwnerService
	PatientSevice  lara.PatientService
	RecordService  lara.RecordService
	SearchService  lara.SearchService
	UserService    lara.UserService
	ProductService lara.ProductService
	ReportService  lara.ReportService
	TitleService   lara.TitleService
	UnitService    lara.UnitService
	GenderService  lara.GenderService
	SpeciesService lara.SpeciesService
	BreedService   lara.BreedService
	AddressService lara.AddressService
	TagService     lara.TagService

	// Auth
	Token AuthToken

	// WWW root
	WWWRoot string
	// contains filtered or unexported fields
}

Server server REST API and client web application

func (*Server) Router

func (s *Server) Router() *chi.Mux

Router configures and returns URL router for http server. Method is not intended to be called directly except for unit tests.

func (*Server) Serve

func (s *Server) Serve(Hostname string, Port uint, CertFile string, KeyFile string) error

Serve starts TLS server. Method blocks until server stopped from another goroutine or error occurs.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown stops server gracefully

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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