router

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFromJSON

func BindFromJSON(body io.ReadCloser, v interface{}) (err error)

BindFromJSON ...

func NewHolidays

func NewHolidays(bloc presenter.HolidayBloc) router.HTTPRouter

func RenderError

func RenderError(w http.ResponseWriter, err error)

RenderError ...

func RenderJSON

func RenderJSON(w http.ResponseWriter, s int, v interface{})

RenderJSON ...

Types

type DateRange

type DateRange struct {
	From string `json:"from,omitempty"`
	To   string `json:"to,omitempty"`
}

type Holiday

type Holiday struct {
	Date         string  `json:"date,omitempty"`
	Name         string  `json:"name,omitempty"`
	DifinitionID int     `json:"difinition_id,omitempty"`
	Summary      *string `json:"summary,omitempty"`
	Description  *string `json:"description,omitempty"`
}

type HolidaySearchRequest

type HolidaySearchRequest struct {
	Fields    []string   `json:"fields"`
	DateRange *DateRange `json:"date"`
	Limit     int        `json:"limit"`
	Offset    int        `json:"offset"`
}

type HolidaySearchResponse

type HolidaySearchResponse struct {
	Holidays []*Holiday           `json:"holidays"`
	Request  HolidaySearchRequest `json:"request"`
}

type HolidaysRouter

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

HolidaysRouter ...

func (*HolidaysRouter) Find

func (rt *HolidaysRouter) Find(w http.ResponseWriter, r *http.Request)

func (*HolidaysRouter) Import

func (rt *HolidaysRouter) Import(w http.ResponseWriter, r *http.Request)

func (*HolidaysRouter) Route

func (rt *HolidaysRouter) Route(mux *chi.Mux) (err error)

func (*HolidaysRouter) Search

func (rt *HolidaysRouter) Search(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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