rest

package
v0.0.0-...-ea6506d Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package rest contains a REST handler for eventdb. It wraps Service in a web-accessible API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShiftPath

func ShiftPath(p string) (head, tail string)

ShiftPath splits off the first component of p, which will be cleaned of relative components before processing. head will never contain a slash and tail will always be a rooted path without trailing slash.

Types

type DestsHandler

type DestsHandler struct {
	http.Handler // router
	// contains filtered or unexported fields
}

DestsHandler provies a REST interface to eventdb's dest-related functions.

func (*DestsHandler) HandleGenerate

func (h *DestsHandler) HandleGenerate(w http.ResponseWriter, r *http.Request)

HandleGenerate wraps Service.DestGenerate in a REST interface

func (*DestsHandler) HandleGet

func (h *DestsHandler) HandleGet(w http.ResponseWriter, r *http.Request)

HandleGet wraps Service.DestGet in a REST interface

func (*DestsHandler) HandleList

func (h *DestsHandler) HandleList(w http.ResponseWriter, r *http.Request)

HandleList wraps Service.DestList in a REST interface

func (*DestsHandler) HandleUpdate

func (h *DestsHandler) HandleUpdate(w http.ResponseWriter, r *http.Request)

HandleUpdate wraps Service.DestUpdate in a REST interface

type EventsHandler

type EventsHandler struct {
	http.Handler // router
	// contains filtered or unexported fields
}

EventsHandler provies a REST interface to eventdb's event-related functions.

func (*EventsHandler) HandleGet

func (h *EventsHandler) HandleGet(w http.ResponseWriter, r *http.Request)

HandleGet wraps Service.EventGet in a REST interface

func (*EventsHandler) HandleSearch

func (h *EventsHandler) HandleSearch(w http.ResponseWriter, r *http.Request)

HandleSearch wraps Service.EventSearch in a REST interface

func (*EventsHandler) HandleSubmit

func (h *EventsHandler) HandleSubmit(w http.ResponseWriter, r *http.Request)

HandleSubmit wraps Service.EventSubmit in a REST interface

type Handler

type Handler struct {
	Auth auth.Provider

	UsersHandler  *UsersHandler
	EventsHandler *EventsHandler
	DestsHandler  *DestsHandler
}

Handler is an http.Handler that provides a REST interface for eventdb.

func New

func New(service *service.Service) *Handler

New creates a new REST service wrapping an eventdb Service.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type UsersHandler

type UsersHandler struct {
	http.Handler // router
	// contains filtered or unexported fields
}

UsersHandler provides a REST interface to eventdb's user-related functions.

func (*UsersHandler) HandleGet

func (h *UsersHandler) HandleGet(w http.ResponseWriter, r *http.Request)

HandleGet wraps Service.UserGet in a REST interface

func (*UsersHandler) HandleUpdate

func (h *UsersHandler) HandleUpdate(w http.ResponseWriter, r *http.Request)

HandleUpdate wraps Service.UserUpdate in a REST interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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