handlers

package
v0.0.0-...-739355d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntFromString

func IntFromString(writer http.ResponseWriter, v string) (int, error)

func Unmarshal

func Unmarshal(writer http.ResponseWriter, data []byte, v interface{}) error

func WriteError

func WriteError(writer http.ResponseWriter, err error)

func WriteResponse

func WriteResponse(writer http.ResponseWriter, response Response)

Types

type EventHandler

type EventHandler interface {
	Get(w http.ResponseWriter, r *http.Request)
	List(w http.ResponseWriter, r *http.Request)
	Create(w http.ResponseWriter, r *http.Request)
	Update(w http.ResponseWriter, r *http.Request)
	Cancel(w http.ResponseWriter, r *http.Request)
	Reschedule(w http.ResponseWriter, r *http.Request)
	Delete(w http.ResponseWriter, r *http.Request)
}

EventHandler defines the contract for all the handlers.

func NewEventHandler

func NewEventHandler(store store.EventStore) EventHandler

NewEventHandler creates and returns a new EventHandler.

type Response

type Response interface {
	Json() []byte
	StatusCode() int
}

Jump to

Keyboard shortcuts

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