strings

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUnquote = Unquote{}

Functions

This section is empty.

Types

type FinderJSONAttr

type FinderJSONAttr struct {
	AttrPath string `json:"attr_path" desc:"json value path, e.g. a.b[0].c" validate:"required"`
	// contains filtered or unexported fields
}

func NewFinderJSONAttr

func NewFinderJSONAttr(attrPath string) (*FinderJSONAttr, error)

func (*FinderJSONAttr) Build

func (finder *FinderJSONAttr) Build() (pipeline.Handler, error)

func (FinderJSONAttr) Handle

func (finder FinderJSONAttr) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type Join

type Join struct {
	SeparatorConf
}

func (Join) Handle

func (str Join) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type RegexpAllReplacer

type RegexpAllReplacer struct {
	Expr        string `json:"expr" validate:"required"`
	Replacement string `json:"replacement" validate:"required"`
	// contains filtered or unexported fields
}

func (RegexpAllReplacer) Build

func (r RegexpAllReplacer) Build() (pipeline.Handler, error)

func (*RegexpAllReplacer) Handle

func (r *RegexpAllReplacer) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type Replacer

type Replacer struct {
	Old string `json:"old" validate:"required"`
	New string `json:"new" validate:"-"`
	N   int    `json:"n" validate:"gte=-1"`
}

func (Replacer) Build

func (replacer Replacer) Build() (pipeline.Handler, error)

func (*Replacer) Handle

func (replacer *Replacer) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type SeparatorConf

type SeparatorConf struct {
	Type      string `json:"type" desc:"enum: join|split" validate:"required"`
	Separator string `json:"separator" validate:"required"`
}

func (SeparatorConf) Build

func (separator SeparatorConf) Build() (pipeline.Handler, error)

type Split

type Split struct {
	SeparatorConf
}

func (Split) Handle

func (str Split) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type Unquote

type Unquote struct{}

func (Unquote) Handle

func (Unquote) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

Jump to

Keyboard shortcuts

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