userscontroller

package
v6.5.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UsersController

type UsersController interface {
	// Authenticate is middleware that will gate access to any handlers
	// down the chain. After Authenticate has been called, and it has
	// successfuly next, you can access the user object using:
	// `user := usercontext.FromContext(r.Context())`
	Authenticate(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

	// List returns a list of the top ten users, ranked by
	// their riches.
	List(rw http.ResponseWriter, r *http.Request)

	// Login returns a user object, along with a nested profile. The
	// id_token should be used as the a "Authorization Bearer" token
	// for example: `curl -H 'Authorization: Bearer <id_token>' http://...`
	Login(rw http.ResponseWriter, r *http.Request)

	// Token returns a user object, along with a nested profile. The
	// refresh_token should be in the POST body with a grant_type of refresh_token
	// for example:
	// “`
	// curl \
	//   -H 'Content-Type: application/json' \
	//   -d '{"grant_type": "refresh_token", "refresh_token": "<token>"}' \
	//   http://...`
	//
	Token(rw http.ResponseWriter, r *http.Request)
}

UsersController handles HTTP requests regarding users

func New

New constructs a new UsersController instance

Jump to

Keyboard shortcuts

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