http

package
v0.0.0-...-0b17b06 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(resources []Resource) http.Handler

Handle first invokes the common handler chain and then corresponding resource

func HandleAssets

func HandleAssets(pref string, fs http.FileSystem) http.Handler

func HandleFeatures

func HandleFeatures() http.Handler

todo add link as soon as the URL to the HomeApp API is stable

func HandleIdpDemo

func HandleIdpDemo(assetBasePath string, renderhtml func(w io.Writer, data interface{}, templatename string) error) http.Handler

func HandleRoot

func HandleRoot(assetBasePath string, renderhtml func(w io.Writer, data interface{}, templatename string) error, version string) http.Handler

func NewVacationRequestHandler

func NewVacationRequestHandler(assetBasePath string,
	renderhtml func(w io.Writer, data interface{}, templatename string) error,
	storage domain.VacationRequestRepository,
	applyForVacation applyForVacation.Service,
	cancelVacation cancelVacation.Service,
	rejectVacationRequest rejectVacationRequest.Service,
	acceptVacationRequest acceptVacationRequest.Service) *vacationRequestHandler

func Serve

func Serve(l net.Listener, handler http.Handler) error

Types

type BaseHtmlDto

type BaseHtmlDto struct {
	AssetBasePath string
}

type FeatureDto

type FeatureDto struct {
	Url         string `json:"url"`
	Title       string `json:"title"`
	Subtitle    string `json:"subtitle"`
	IconURI     string `json:"iconURI"`
	Summary     string `json:"summary"`
	Description string `json:"description"`
	Color       string `json:"color"`
}

type FeaturesDto

type FeaturesDto struct {
	Features []FeatureDto `json:"features"`
}

type HalLinkObject

type HalLinkObject struct {
	Href      string `json:"href"`
	Templated bool   `json:"templated,omitempty"`
}

HalLinkObject represents a HAL Link Object as defined in https://tools.ietf.org/html/draft-kelly-json-hal-08#section-5

type HalResource

type HalResource struct {
	Links map[string]HalLinkObject `json:"_links"`
}

HalResource represents a HAL Resource Object as defined in https://tools.ietf.org/html/draft-kelly-json-hal-08#section-4

type IdpDemoHtmlDto

type IdpDemoHtmlDto struct {
	BaseHtmlDto
	UserId   string
	UserName string
	Title    string
}

type Resource

type Resource struct {
	Pattern string
	Handler http.Handler
}

type RootHtmlDto

type RootHtmlDto struct {
	BaseHtmlDto
	Title   string
	Version string
}

type VacationRequestDto

type VacationRequestDto struct {
	From    time.Time `json:"from"`
	To      time.Time `json:"to"`
	Type    string    `json:"type"`
	State   string    `json:"state"`
	Comment string    `json:"comment"`
	Id      string    `json:"id"`
}

func (*VacationRequestDto) ToDomain

func (dto *VacationRequestDto) ToDomain() (domain.VacationRequest, error)

type VacationRequestHtmlDto

type VacationRequestHtmlDto struct {
	BaseHtmlDto
	Title   string
	Mode    string
	From    string
	To      string
	Type    string
	State   string
	Comment string
	Id      string
}

type VacationRequestListHtmlDto

type VacationRequestListHtmlDto struct {
	BaseHtmlDto
	Title    string
	Requests []VacationRequestHtmlDto
}

type VacationRequestPatchDto

type VacationRequestPatchDto struct {
	State string `json:"state"`
}

Jump to

Keyboard shortcuts

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