utility

package module
v0.0.0-...-8509807 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: MIT Imports: 11 Imported by: 0

README

utility Build Status Coverage Status Go Report Card GoDoc

Utility functions for Go projects on Google App Engine

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Geturl

func Geturl(ctx context.Context, url string, ttl time.Duration) ([]byte, error)

Geturl performs an HTTP GET request and caches the result to the datastore so you can safely retrieve the same url many times over without hammering a server or depleting a quota.

func WithSession

WithSession extends the signature of http.HandlerFunc with a session parameter, and returns a regular http.HandlerFunc to be used with http.HandleFunc. When your function is called, it will always be passed a valid session object along with the Request and ResponseWriter.

Types

type HandlerFuncWithSession

type HandlerFuncWithSession func(http.ResponseWriter, *http.Request, session.Session)

The HandlerFuncWithSession type has a similar signature to http.HandlerFunc, but adds a session parameter. Write your handler function with this signature to use sessions.

Jump to

Keyboard shortcuts

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