MCPcopy Create free account
hub / github.com/kataras/iris / SetVersion

Function SetVersion

versioning/version.go:198–200  ·  view source on GitHub ↗

SetVersion force-sets the API Version. It can be used inside a middleware. Example of how you can change the default behavior to extract a requested version (which is by headers) from a "version" url parameter instead: func(ctx iris.Context) { // &version=1 version := ctx.URLParamDefault("vers

(ctx *context.Context, constraint string)

Source from the content-addressed store, hash-verified

196//
197// See `GetVersion` too.
198func SetVersion(ctx *context.Context, constraint string) {
199 ctx.Values().Set(ctx.Application().ConfigurationReadOnly().GetVersionContextKey(), constraint)
200}
201
202// AliasMap is just a type alias of the standard map[string]string.
203// Head over to the `Aliases` function below for more.

Callers 4

TestGetVersionFunction · 0.92
TestVersionAliasesFunction · 0.92
FromQueryFunction · 0.85
matchVersionRangeFunction · 0.85

Calls 5

ApplicationMethod · 0.80
SetMethod · 0.65
GetVersionContextKeyMethod · 0.65
ConfigurationReadOnlyMethod · 0.65
ValuesMethod · 0.45

Tested by 2

TestGetVersionFunction · 0.74
TestVersionAliasesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…