purge

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: GPL-3.0 Imports: 9 Imported by: 1

README

#Purge

##Configuration: no configuration is required for the handler

##API:

Make a POST request with the following body to any URL handled by the purge handler, with a body as follows:

 [
	 "http://example.com/path/to/a/file/to/be/purged",
	 "http://example.com/path/to/another/file"
 ]

The returned result will be of the form:

{
	"http://example.com/path/to/a/file/to/be/purged":true,
	"http://example.com/path/to/another/file":false
}

the map in the result will have for value true if files have been deleted and false otherwise.

##TODO:

  • async api with meaningful urls
  • glob matching
  • authentication of any kind

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is a simple handler that handles the server purge page.

func New

func New(cfg *config.Handler, l *types.Location, next types.RequestHandler) (*Handler, error)

New creates and returns a ready to used ServerPurgeHandler.

func (*Handler) RequestHandle

func (ph *Handler) RequestHandle(ctx context.Context, w http.ResponseWriter, r *http.Request)

RequestHandle servers the purge page.

Jump to

Keyboard shortcuts

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