param

package
v0.0.0-...-d8d3109 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParamsUnSet = errors.New("param unset")

Functions

This section is empty.

Types

type File

type File struct {
	ContentType string
	Path        string
	Basename    string
	Ext         string
}

func NewFile

func NewFile(filePath string) *File

func (*File) ArchiveMove

func (f *File) ArchiveMove(dir string) (*File, string)

func (*File) Move

func (f *File) Move(dest string) *File

type Helper

type Helper[V IRequestInput] struct {
	// contains filtered or unexported fields
}

func NewParamHelper

func NewParamHelper[V IRequestInput](m *RequestParamPairs[V]) *Helper[V]

func (*Helper[V]) Bool

func (h *Helper[V]) Bool(s string, def ...bool) (ret bool, err error)

func (*Helper[V]) File

func (h *Helper[V]) File(s string) (f *File, err error)

func (*Helper[V]) FileSlice

func (h *Helper[V]) FileSlice(s string) (f []*RequestParamItem[*File], err error)

func (*Helper[V]) Float64

func (h *Helper[V]) Float64(s string, def ...float64) (ret float64, err error)

func (*Helper[V]) Int

func (h *Helper[V]) Int(s string, def ...int) (ret int, err error)

func (*Helper[V]) Int64

func (h *Helper[V]) Int64(s string, def ...int64) (ret int64, err error)

func (*Helper[V]) MustBool

func (h *Helper[V]) MustBool(s string) bool

func (*Helper[V]) MustFile

func (h *Helper[V]) MustFile(s string) *File

func (*Helper[V]) MustFileSlice

func (h *Helper[V]) MustFileSlice(s string) []*RequestParamItem[*File]

func (*Helper[V]) MustFloat64

func (h *Helper[V]) MustFloat64(s string) float64

func (*Helper[V]) MustInt

func (h *Helper[V]) MustInt(s string) int

func (*Helper[V]) MustInt64

func (h *Helper[V]) MustInt64(s string) int64

func (*Helper[V]) MustSlice

func (h *Helper[V]) MustSlice(s string) []*RequestParamItem[string]

func (*Helper[V]) MustString

func (h *Helper[V]) MustString(s string) string

func (*Helper[V]) Raw

func (h *Helper[V]) Raw() *mapping.HashMap[string, V]

func (*Helper[V]) Slice

func (h *Helper[V]) Slice(s string) (r []*RequestParamItem[string], err error)

func (*Helper[V]) String

func (h *Helper[V]) String(s string, def ...string) (ret string, err error)

type IRequestInput

type IRequestInput interface {
	*RequestParamItems[string] | *RequestParamItems[*File]
}

type IRequestParamItemType

type IRequestParamItemType interface {
	string | *File
}

type RequestParamItem

type RequestParamItem[T IRequestParamItemType] struct {
	// contains filtered or unexported fields
}

func NewRequestParamItem

func NewRequestParamItem[T IRequestParamItemType](v T) *RequestParamItem[T]

func (*RequestParamItem[T]) Bool

func (r *RequestParamItem[T]) Bool() bool

func (*RequestParamItem[T]) File

func (r *RequestParamItem[T]) File() *File

func (*RequestParamItem[T]) Float64

func (r *RequestParamItem[T]) Float64() float64

func (*RequestParamItem[T]) Int

func (r *RequestParamItem[T]) Int() int

func (*RequestParamItem[T]) Int64

func (r *RequestParamItem[T]) Int64() int64

func (*RequestParamItem[T]) String

func (r *RequestParamItem[T]) String() string

type RequestParamItems

type RequestParamItems[T IRequestParamItemType] struct {
	// contains filtered or unexported fields
}

func NewRequestParamItems

func NewRequestParamItems[T IRequestParamItemType](value []T) *RequestParamItems[T]

func (*RequestParamItems[T]) Bool

func (r *RequestParamItems[T]) Bool() bool

func (*RequestParamItems[T]) File

func (r *RequestParamItems[T]) File() *File

func (*RequestParamItems[T]) Float64

func (r *RequestParamItems[T]) Float64() float64

func (*RequestParamItems[T]) GetParams

func (r *RequestParamItems[T]) GetParams() []*RequestParamItem[T]

func (*RequestParamItems[T]) Int

func (r *RequestParamItems[T]) Int() int

func (*RequestParamItems[T]) Int64

func (r *RequestParamItems[T]) Int64() int64

func (*RequestParamItems[T]) SetParams

func (r *RequestParamItems[T]) SetParams(rpa []*RequestParamItem[T]) *RequestParamItems[T]

func (*RequestParamItems[T]) Slice

func (r *RequestParamItems[T]) Slice() []*RequestParamItem[T]

func (*RequestParamItems[T]) String

func (r *RequestParamItems[T]) String() string

type RequestParamPairs

type RequestParamPairs[V any] mapping.HashMap[string, V]

func NewRequestParamPairs

func NewRequestParamPairs[V any]() *RequestParamPairs[V]

func (*RequestParamPairs[V]) Raw

func (p *RequestParamPairs[V]) Raw() *mapping.HashMap[string, V]

Jump to

Keyboard shortcuts

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