web

package
v0.0.0-...-42776a7 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitHubOAuthConfig

func NewGitHubOAuthConfig(clientID, clientSecret string) *oauth2.Config

func NewLinkedInOAuthConfig

func NewLinkedInOAuthConfig(clientID, clientSecret, redirectURL string) *oauth2.Config

func NewServer

func NewServer(
	store petfind.Store,
	sessionStore sessions.Store,
	sessionTTL int,
	sessionMaxTTL int,
	CSRF func(http.Handler) http.Handler,
	templatePath string,
	photoStore petfind.PhotoStore,
	githubOAuth *oauth2.Config,
	linkedinOAuth *oauth2.Config,
) (http.Handler, error)

NewServer initializes and returns a new HTTP server.

sessionTTL is used to extend the session's idle timeout.

sessionMaxTTL is used to check if a session has expired by surpassing its absolute timeout.

Types

type Error

type Error struct {
	Err     error
	Message string
	Code    int
}

Error can be returned by the handlers of application's HTTP server.

func E

func E(err error, message string, code int) *Error

E constructs an *Error and can be used as a shorthand when a handler returns an *Error.

func (Error) Error

func (e Error) Error() string

type LinkedinError

type LinkedinError struct {
	ErrorCode int    `json:"errorCode"`
	Message   string `json:"message"`
	RequestID string `json:"requestId"`
	Status    int    `json:"status"`
	Timestamp int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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