parameters

package
v0.0.0-...-3f97f43 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadParametersFromHTTPRequest

func LoadParametersFromHTTPRequest(params ParametersAPI, r *http.Request)

LoadParametersFromHTTPRequest - Load Parameters from http.Request

func LoadParametersFromMultipartForm

func LoadParametersFromMultipartForm(params ParametersAPI, mpartform *multipart.Form) (err error)

LoadParametersFromMultipartForm - Load Parameters from *multipart.Form

func LoadParametersFromRawURL

func LoadParametersFromRawURL(params ParametersAPI, rawURL string)

LoadParametersFromRawURL - populate paramaters just from raw url

func LoadParametersFromUrlValues

func LoadParametersFromUrlValues(params ParametersAPI, urlvalues url.Values) (err error)

LoadParametersFromUrlValues - Load Parameters from url.Values

Types

type Parameters

type Parameters struct {
	// contains filtered or unexported fields
}

Parameters -> structure containing parameters

func NewParameters

func NewParameters() *Parameters

NewParameters return new instance of Paramaters container

func (*Parameters) AppendPhrase

func (params *Parameters) AppendPhrase(phrases ...string)

func (*Parameters) CleanupParameters

func (params *Parameters) CleanupParameters()

CleanupParameters function that can be called to assist in cleaning up instance of Parameter container

func (*Parameters) ContainsFileParameter

func (params *Parameters) ContainsFileParameter(pname string) bool

ContainsFileParameter -> check if file parameter exist pname : name

func (*Parameters) ContainsParameter

func (params *Parameters) ContainsParameter(pname string) bool

ContainsParameter -> check if parameter exist pname : name

func (*Parameters) ContainsPhrase

func (params *Parameters) ContainsPhrase(...string) (exists bool)

func (*Parameters) FileKeys

func (params *Parameters) FileKeys() (keys []string)

FileKeys - list of file parameters names (keys)

func (*Parameters) FileName

func (params *Parameters) FileName(pname string, index ...int) (nmes []string)

FileName return file parameter name - array of string

func (*Parameters) FileParameter

func (params *Parameters) FileParameter(pname string, index ...int) []interface{}

FileParameter return file paramater - array of file

func (*Parameters) FileReader

func (params *Parameters) FileReader(pname string, index ...int) (rdrs []io.Reader)

FileReader return file parameter - array of io.Reader

func (*Parameters) FileSize

func (params *Parameters) FileSize(pname string, index ...int) (sizes []int64)

FileSize return file parameter size - array of int64)

func (*Parameters) Parameter

func (params *Parameters) Parameter(pname string, index ...int) []string

Parameter - return a specific parameter values

func (*Parameters) Phrases

func (params *Parameters) Phrases() (phrases []string)

func (*Parameters) RemoveParameter

func (params *Parameters) RemoveParameter(pname string) (value []string)

RemoveParameter -> remove parameter and return any slice of string value

func (*Parameters) SetFileParameter

func (params *Parameters) SetFileParameter(pname string, clear bool, pfile ...interface{})

SetFileParameter -> set or append file parameter value pname : name pfile : value of interface to add either FileHeader from mime/multipart or any io.Reader implementation clear : clear existing value of parameter

func (*Parameters) SetParameter

func (params *Parameters) SetParameter(pname string, clear bool, pvalue ...string)

SetParameter -> set or append parameter value pname : name pvalue : value of strings to add clear : clear existing value of parameter

func (*Parameters) StandardKeys

func (params *Parameters) StandardKeys() (keys []string)

StandardKeys - list of standard parameters names (keys)

func (*Parameters) StringParameter

func (params *Parameters) StringParameter(pname string, sep string, index ...int) (s string)

StringParameter return parameter as string concatenated with sep

type ParametersAPI

type ParametersAPI interface {
	StandardKeys() []string
	FileKeys() []string
	SetParameter(string, bool, ...string)
	AppendPhrase(...string)
	Phrases() []string
	ContainsPhrase(...string) bool
	ContainsParameter(string) bool
	RemoveParameter(string) []string
	SetFileParameter(string, bool, ...interface{})
	ContainsFileParameter(string) bool
	Parameter(string, ...int) []string
	StringParameter(string, string, ...int) string
	FileReader(string, ...int) []io.Reader
	FileName(string, ...int) []string
	FileSize(string, ...int) []int64
	FileParameter(string, ...int) []interface{}
	CleanupParameters()
}

Jump to

Keyboard shortcuts

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