formencoded

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

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "form-urlencoded"

Name represents the codec

Variables

This section is empty.

Functions

func BoolEmpty

func BoolEmpty(val interface{}) string

BoolEmpty returns the given value as a bool or a empty bool if the value is nil

func BytesBase64Empty

func BytesBase64Empty(val interface{}) string

BytesBase64Empty returns the given bytes buffer as a base64 string or a empty string if the value is nil

func Float32Empty

func Float32Empty(val interface{}) string

Float32Empty returns the given value as a float32 or a empty float32 if the value is nil

func Float64Empty

func Float64Empty(val interface{}) string

Float64Empty returns the given value as a float64 or a empty float64 if the value is nil

func Int32Empty

func Int32Empty(val interface{}) string

Int32Empty returns the given value as a int32 or a empty int32 if the value is nil

func Int64Empty

func Int64Empty(val interface{}) string

Int64Empty returns the given value as a int64 or a empty int64 if the value is nil

func StringEmpty

func StringEmpty(val interface{}) string

StringEmpty returns the given value as a string or a empty string if the value is nil

func Uint32Empty

func Uint32Empty(val interface{}) string

Uint32Empty returns the given value as a uint32 or a empty uint32 if the value is nil

func Uint64Empty

func Uint64Empty(val interface{}) string

Uint64Empty returns the given value as a uint64 or a empty uint64 if the value is nil

Types

type Constructor

type Constructor struct {
}

Constructor is capable of constructing new codec managers for the given resource and specs

func NewConstructor

func NewConstructor() *Constructor

NewConstructor constructs a new www-form-urlencoded constructor

func (*Constructor) Name

func (constructor *Constructor) Name() string

Name returns the name of the www-form-urlencoded codec constructor

func (*Constructor) New

func (constructor *Constructor) New(resource string, specs *specs.ParameterMap) (codec.Manager, error)

New constructs a new www-form-urlencoded codec manager

type ErrUndefinedSpecs

type ErrUndefinedSpecs struct{}

ErrUndefinedSpecs occurs when spacs are nil

func (ErrUndefinedSpecs) Error

func (e ErrUndefinedSpecs) Error() string

Error returns a description of the given error as a string

func (ErrUndefinedSpecs) Prettify

func (e ErrUndefinedSpecs) Prettify() prettyerr.Error

Prettify returns the prettified version of the given error

type Manager

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

Manager manages a specs object and allows to encode/decode messages

func (*Manager) Marshal

func (manager *Manager) Marshal(store references.Store) (io.Reader, error)

Marshal marshals the given reference store into a www-form-urlencoded message. This method is called during runtime to encode a new message with the values stored inside the given reference store

func (*Manager) Name

func (manager *Manager) Name() string

Name returns the proto codec name

func (*Manager) Property

func (manager *Manager) Property() *specs.Property

Property returns the manager property which is used to marshal and unmarshal data

func (*Manager) Unmarshal

func (manager *Manager) Unmarshal(reader io.Reader, refs references.Store) error

Unmarshal the given www-form-urlencoded io reader into the given reference store. This method is called during runtime to decode a new message and store it inside the given reference store.

Note: it does not work yet and returns error "not implemented yet" for every call.

Jump to

Keyboard shortcuts

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