wssearch

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateInitialSettings

func CreateInitialSettings(filename string) error

CreateInitialSettings creates a settings file with everything necessary for starting the web service. Everything else is taken from the cache header file.

Types

type HandlerContext

type HandlerContext struct {
	Settings Settings
	Map      *mmap.ReaderAt
	Idx      *ratecache.CacheIndex
	Fhdr     *ratecache.FileHeader
}

func (*HandlerContext) AccoListHandler

func (context *HandlerContext) AccoListHandler(w http.ResponseWriter, r *http.Request)

AccoListHandler provides an ordered list of all accommodation codes

func (*HandlerContext) AddIndexHandler

func (context *HandlerContext) AddIndexHandler(w http.ResponseWriter, r *http.Request)

adds an index entry to the index based on the json data received in the body

func (HandlerContext) Find

func (context HandlerContext) Find(idxResults []ratecache.IdxResult, searchRq ratecache.SearchRq) ratecache.SearchRs

func (*HandlerContext) FindHandler

func (context *HandlerContext) FindHandler(w http.ResponseWriter, r *http.Request)

func (*HandlerContext) RoomListHandler

func (context *HandlerContext) RoomListHandler(w http.ResponseWriter, r *http.Request)

RoomListHandler provides all room rate codes and the corresponding occupancies for one accommodation

type Settings

type Settings struct {
	Port          int    `json:"port"`
	CacheDir      string `json:"cacheDir"`
	IndexDir      string `json:"indexDir"`
	CacheFilename string `json:"cacheFilename"`
	DecimalPlaces uint8  `json:"decimalPlaces"`
}

func LoadSettings

func LoadSettings(filename string) (Settings, error)

Jump to

Keyboard shortcuts

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