http

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerDocumentRepository

func HandlerDocumentRepository(repo flare.DocumentRepositorier) func(*Handler)

HandlerDocumentRepository set the repository to access the documents.

func HandlerGetDocumentID

func HandlerGetDocumentID(fn func(*http.Request) string) func(*Handler)

HandlerGetDocumentID set the function to get the document id.

func HandlerResourceRepository

func HandlerResourceRepository(repo flare.ResourceRepositorier) func(*Handler)

HandlerResourceRepository set the repository to access the resources.

func HandlerSubscriptionRepository

func HandlerSubscriptionRepository(repo flare.SubscriptionRepositorier) func(*Handler)

HandlerSubscriptionRepository set the repository to access the subscriptions.

func HandlerSubscriptionTrigger

func HandlerSubscriptionTrigger(trigger flare.SubscriptionTrigger) func(*Handler)

HandlerSubscriptionTrigger set the subscription trigger to process the document updates.

func HandlerWriter

func HandlerWriter(writer *infraHTTP.Writer) func(*Handler)

HandlerWriter set the writer to send the content to client.

Types

type Handler

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

Handler implements the HTTP handler to manage documents.

func NewHandler

func NewHandler(options ...func(*Handler)) (*Handler, error)

NewHandler initialize the service to handle HTTP requests.

func (*Handler) Delete

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

Delete receive the request to delete a document.

func (*Handler) Show

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

Show receive the request to show a given document.

func (*Handler) Update

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

Update process the request to update a document.

Jump to

Keyboard shortcuts

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