Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, fn func() BodyProcessor)
Register registers a body processor by name. If the body processor is already registered, it will be overwritten
Types ¶
type BodyProcessor ¶
type BodyProcessor interface { ProcessRequest(reader io.Reader, collection [types.VariablesCount]collection.Collection, options Options) error ProcessResponse(reader io.Reader, collection [types.VariablesCount]collection.Collection, options Options) error }
BodyProcessor interface is used to create body processors for different content-types. They are able to read the body, force a collection. Hook to some variable and return data based on special expressions like XPATH, JQ, etc.
func Get ¶
func Get(name string) (BodyProcessor, error)
Get returns a body processor by name If the body processor is not found, it returns an error
type Options ¶
type Options struct { // Mime is the type of the body, it may contain parameters // like charset, boundary, etc. Mime string // StoragePath is the path where the body will be stored StoragePath string // FileMode is the mode of the file that will be created FileMode fs.FileMode // DirMode is the mode of the directory that will be created DirMode fs.FileMode }
Options are used by BodyProcessors to provide some settings like a path to store temporary files. Implementations may ignore the options.
Click to show internal directories.
Click to hide internal directories.