resources

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Hello                           = "hello"
	Goodbye                         = "goodbye"
	WhereAmI                        = "where am I?"
	HelloWorld                      = "hello world"
	TestFilePath                    = "./internal/resources/testing.go"
	TestContentType                 = "application/json"
	TestRoute                       = "/test/route"
	TestRouteTwo                    = "/test/route/two"
	TestRouteThree                  = "/test/route/three"
	TestRoutePathParams             = "/test/route/{param}"
	TestRoutePathParamHello         = "/test/route/hello"
	TestRoutePathParamGoodbye       = "/test/route/goodbye"
	TestErrorResponse               = "{ \"title\": \"Resource Not Found\", \"detail\": \"no path to file provided\", \"status\": \"404\" }"
	TestMethodNotAllowed            = "" /* 127-byte string literal not displayed */
	TestMethodNotAllowedHandlerResp = "this method isn't allowed, sorry\n"
)

Variables

View Source
var (
	NoDefaultResponse         = errors.New("no default response set")
	NoDefaultErrorResponse    = errors.New("no default error response set")
	NoWaggyEntryPointProvided = errors.New("no entrypoint provided to serve")
)
View Source
var (
	TestError     = errors.New("this is a test Waggy Error")
	TestLogFile   = &os.File{}
	TestKey       = "testKey"
	TestMapKey1   = "testMapKey1"
	TestMapKey2   = "testMapKey2"
	TestMapKey3   = "testMapKey3"
	TestMapValue1 = []string{Hello}
	TestMapValue2 = []string{Hello, Goodbye}
	TestMapValue3 = make([]string, 0)
	TestMessage   = "testMessage"
	TestValue     = "testValue"
	TestQueryMap  = func() map[string][]string {
		m := make(map[string][]string)
		m[TestMapKey1] = TestMapValue1
		m[TestMapKey2] = TestMapValue2
		m[TestMapKey3] = TestMapValue3

		return m
	}
	TestListenAndServeAddr = fmt.Sprintf("localhost:3000")
	TestMethods            = []string{http.MethodDelete, http.MethodGet}
	TestRoutes             = []string{TestRoute, TestRouteTwo}
)
View Source
var AllHTTPMethods = func() map[string]struct{} {
	m := make(map[string]struct{})
	m[http.MethodGet] = struct{}{}
	m[http.MethodPut] = struct{}{}
	m[http.MethodPost] = struct{}{}
	m[http.MethodPatch] = struct{}{}
	m[http.MethodOptions] = struct{}{}
	m[http.MethodConnect] = struct{}{}
	m[http.MethodDelete] = struct{}{}
	m[http.MethodTrace] = struct{}{}
	m[http.MethodHead] = struct{}{}

	return m
}

Functions

func GetFunctionPtr added in v0.5.7

func GetFunctionPtr(i interface{}) uintptr

Types

type ContextKey

type ContextKey int
const (
	DefResp ContextKey = iota
	DefErr
	MatchedRoute
	RootRoute
	PathParams
	QueryParams
	Logger
)

Jump to

Keyboard shortcuts

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