context

package
v0.0.0-...-d26fc85 Latest Latest
Warning

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

Go to latest
Published: May 2, 2015 License: BSD-3-Clause Imports: 4 Imported by: 7

Documentation

Overview

Package context creates a context to pass to each api-server route handlers functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// DB is an active connection to the database.
	DB *sql.DB

	// SinceID corresponds to an ID since which to show results.
	SinceID uint64

	// PerPage corresponds to the number of results to show per page.
	PerPage uint64

	// PageNumber shall be used to paginate results when necessary.
	PageNumber uint64
}

Context represents a context of a query to the API server that is meant to be used by route handlers functions.

func NewContext

func NewContext(db *sql.DB, r *http.Request) (*Context, error)

NewContext initializes a Context structure.

Jump to

Keyboard shortcuts

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