Documentation ¶
Index ¶
Constants ¶
View Source
const TestAuthKey = "__the_key__"
TestAuthKey is used by HeaderAuthorizer
Variables ¶
This section is empty.
Functions ¶
func SetupFileServer ¶
func SetupFileServer(paths map[string]string, auth Authorizer) *httptest.Server
SetupFileServer serves files from './test_data' directory in package paths map can be used to servre files based on URL path prefixes and query params (for example, check usgs) if paths is nil, url path will be used to find files in dir
Types ¶
type Authorizer ¶
Authorizer is used in test server to simulate auth process
type HeaderAuthorizer ¶
type HeaderAuthorizer struct { // Key is the name of authorization header Key string }
HeaderAuthorizer checks that value of "Key" header equal TestAuthKey
Click to show internal directories.
Click to hide internal directories.