params

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STRING       string = "string"
	BOOL         string = "bool"
	INT          string = "int"
	INT32        string = "int32"
	INT64        string = "int64"
	FLOAT32      string = "float32"
	FLOAT64      string = "float64"
	SHORT_DATE   string = "shortDate" // 2006-01-02
	RFC3339_DATE string = "rfc3339Date"
)

Variables

This section is empty.

Functions

func ENUM

func ENUM(values ...string) []string

func GetAsBool

func GetAsBool(key string, r *http.Request) *bool

func GetAsBoolFromContext added in v1.0.36

func GetAsBoolFromContext(key string, ctx context.Context) *bool

func GetAsFloat32

func GetAsFloat32(key string, r *http.Request) *float32

func GetAsFloat32FromContext added in v1.0.36

func GetAsFloat32FromContext(key string, ctx context.Context) *float32

func GetAsFloat64 added in v1.0.36

func GetAsFloat64(key string, r *http.Request) *float64

func GetAsFloat64FromContext added in v1.0.36

func GetAsFloat64FromContext(key string, ctx context.Context) *float64

func GetAsInt

func GetAsInt(key string, r *http.Request) *int

func GetAsInt32

func GetAsInt32(key string, r *http.Request) *int32

func GetAsInt32FromContext added in v1.0.36

func GetAsInt32FromContext(key string, ctx context.Context) *int32

func GetAsInt64

func GetAsInt64(key string, r *http.Request) *int64

func GetAsInt64FromContext added in v1.0.36

func GetAsInt64FromContext(key string, ctx context.Context) *int64

func GetAsIntFromContext added in v1.0.36

func GetAsIntFromContext(key string, ctx context.Context) *int

func GetAsString

func GetAsString(key string, r *http.Request) *string

func GetAsStringFromContext added in v1.0.36

func GetAsStringFromContext(key string, ctx context.Context) *string

func GetAsTime

func GetAsTime(key string, r *http.Request) *time.Time

func GetAsTimeFromContext added in v1.0.36

func GetAsTimeFromContext(key string, ctx context.Context) *time.Time

func ParseBool

func ParseBool(value string, key string, validatedMap R, errors *[]error)

func ParseDate

func ParseDate(value string, key string, format string, validatedMap R, errors *[]error)

func ParseEnum

func ParseEnum(value string, enum []string, key string, validatedMap R, errors *[]error)

func ParseFloat

func ParseFloat(value string, key string, bits int, validatedMap R, errors *[]error)

func ParseInt

func ParseInt(value string, key string, bits int, validatedMap R, errors *[]error)

func ParseString added in v1.0.31

func ParseString(value string, key string, validatedMap R, errors *[]error)

func ValidateParams

func ValidateParams(requirement R, actual map[string]string, destination R, required bool) error

Types

type R

type R map[string]interface{}

Jump to

Keyboard shortcuts

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