testutils

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Mux is a multiplexer that can be used to register handlers.
	Mux *http.ServeMux

	// Server is an in-memory HTTP server for testing.
	Server *httptest.Server

	FakeToken = "eyJ0eXAiOiJKV1Q2lkIjo1MTEsImVtCJ1c2V2ns-QgWxERsywROmzASDniT3VHebO1DqgJ5ZIg"

	FakeTokenExpireDate = "2017-04-17T01:28:15.000Z"

	FakeAuthOpts = gcore.AuthOptions{Username: "whatever", Password: "whatever"}
)

Functions

func Endpoint

func Endpoint() string

Endpoint returns a fake endpoint that will actually target the Mux.

func GetAuthenticatedCommonClient

func GetAuthenticatedCommonClient() *gcore.CommonClient

func GetAuthenticatedResellerClient

func GetAuthenticatedResellerClient() *gcore.ResellerClient

func MockClientURL

func MockClientURL() *url.URL

func SetupGCoreAuthServer

func SetupGCoreAuthServer()

Setup endpoints for getting GCore token

func SetupHTTP

func SetupHTTP()

SetupHTTP prepares the Mux and Server.

func TeardownHTTP

func TeardownHTTP()

TeardownHTTP releases HTTP-related resources.

Types

This section is empty.

Jump to

Keyboard shortcuts

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