transformer

package
v0.0.1-rc.5 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LBracket    = "["
	RBracket    = "]"
	SingleQuote = "'"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body interface {
	Transform(c *gin.Context, body any)
}

func Mapper

func Mapper(path string, f Body) Body

func TransformStringField

func TransformStringField(path string, f ...String) Body

type BodyChain

type BodyChain []Body

func (BodyChain) Transform

func (ch BodyChain) Transform(c *gin.Context, body any)

type BodyFunc

type BodyFunc func(c *gin.Context, body any)

func (BodyFunc) Transform

func (f BodyFunc) Transform(c *gin.Context, body any)
type Header interface {
	Transform(c *gin.Context, header http.Header)
}

func RemoveHeader

func RemoveHeader(key string) Header

func ResetContentLength

func ResetContentLength(n int) Header

func SetContentLength

func SetContentLength(n int) Header

type HeaderChain

type HeaderChain []Header

func (HeaderChain) Transform

func (ch HeaderChain) Transform(c *gin.Context, header http.Header)

type HeaderFunc

type HeaderFunc func(c *gin.Context, header http.Header)

func (HeaderFunc) Transform

func (f HeaderFunc) Transform(c *gin.Context, header http.Header)

type Query

type Query interface {
	Transform(c *gin.Context, query url.Values)
}

type QueryChain

type QueryChain []Query

func (QueryChain) Transform

func (ch QueryChain) Transform(c *gin.Context, query url.Values)

type QueryFunc

type QueryFunc func(c *gin.Context, query url.Values)

func (QueryFunc) Transform

func (f QueryFunc) Transform(c *gin.Context, query url.Values)

type String

type String interface {
	Transform(c *gin.Context, s string) string
}

func TrimLeft

func TrimLeft(v string) String

func TrimPrefix

func TrimPrefix(getter StringGetter) String

func TrimRight

func TrimRight(v string) String

type StringChain

type StringChain []String

func (StringChain) Transform

func (ch StringChain) Transform(c *gin.Context, s string) string

type StringFunc

type StringFunc func(c *gin.Context, s string) string

func (StringFunc) Transform

func (f StringFunc) Transform(c *gin.Context, s string) string

type StringGetter

type StringGetter func(c *gin.Context) string

type URL

type URL interface {
	Transform(c *gin.Context, u *url.URL)
}

type URLChain

type URLChain []URL

func (URLChain) Transform

func (ch URLChain) Transform(c *gin.Context, u *url.URL)

type URLFunc

type URLFunc func(c *gin.Context, u *url.URL)

func (URLFunc) Transform

func (f URLFunc) Transform(c *gin.Context, u *url.URL)

Jump to

Keyboard shortcuts

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