resolver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extra

type Extra interface {
	// Args returns a list of additional arguments that can be used to resolve the URL
	Args() []string
	// Query returns a list of additional query parameters that can be used to resolve the URL
	Query() url.Values
}

Extra is an interface that can be used to pass additional information to the url resolver

func Arguments

func Arguments(t require.TestingT, kv ...string) Extra

Arguments adds arguments to the resolver, these are named arguments

func Query

func Query(t require.TestingT, kv ...string) Extra

Query adds query parameters to the resolver

type Resolver

type Resolver interface {
	// ReverseURL returns a URL by given name and extra arguments
	ReverseURL(t require.TestingT, name string, extra ...Extra) string
}

Resolver is an interface that can be used to resolve URLs from the given name and extra arguments

func NewGorillaResolver

func NewGorillaResolver(t require.TestingT, router *mux.Router) Resolver

NewGorillaResolver creates a new gorilla resolver

Jump to

Keyboard shortcuts

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