auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2015 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenFromWeb

func TokenFromWeb(ctx context.Context, config *oauth2.Config) (*oauth2.Token, error)

Types

type Cache

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

func NewCache

func NewCache(config *oauth2.Config) Cache

func (Cache) SaveToken

func (c Cache) SaveToken(token *oauth2.Token) error

func (Cache) Token

func (c Cache) Token() (*oauth2.Token, error)

type Server

type Server struct {
	URL      string // base URL of form http://ipaddr:port with no trailing slash
	Listener net.Listener

	// Config may be changed after calling NewUnstartedServer and
	// before Start
	Config *http.Server
	// contains filtered or unexported fields
}

A Server is an HTTP server listening on a system-chosen port on the local loopback interface.

func NewUnstartedServer

func NewUnstartedServer(handler http.Handler) *Server

NewUnstartedServer returns a new Server but doesn't start it.

After changing its configuration, the caller should call Start.

The caller should call Close when finished, to shut it down.

func (*Server) Close

func (s *Server) Close()

Close shuts down the server and blocks until all outstanding requests on this server have completed.

func (*Server) CloseClientConnections

func (s *Server) CloseClientConnections()

CloseClientConnections closes any currently open HTTP connections to the test Server.

func (*Server) Start

func (s *Server) Start()

Start starts a server from NewUnstartedServer.

Jump to

Keyboard shortcuts

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