encoding

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetByKV

func SetByKV(value reflect.Value, field reflect.StructField, kv PeekV, tagValue string) (isSet bool, err error)

func SetByKV2

func SetByKV2(value reflect.Value, field reflect.StructField, kv PeekVs, tagValue string) (isSet bool, err error)

Types

type Args

type Args []PeekV

func (Args) Peek

func (args Args) Peek(key string) (v string, ok bool)

func (Args) TrySet

func (args Args) TrySet(value reflect.Value, field reflect.StructField, key string) (isSet bool, err error)

type Args2

type Args2 []PeekVs

func (Args2) Peek

func (args Args2) Peek(key string) (v []string, ok bool)

func (Args2) TrySet

func (args Args2) TrySet(value reflect.Value, field reflect.StructField, key string) (isSet bool, err error)

type Format

type Format string
const (
	Json     Format = "json"
	Yaml     Format = "yaml"
	Toml     Format = "toml"
	Yml      Format = "yml"
	Protobuf Format = "protobuf"
	Xml      Format = "xml"
	Text     Format = "text"
)

type KVSource

type KVSource map[string]string

func (KVSource) Peek

func (form KVSource) Peek(key string) ([]string, bool)

func (KVSource) TrySet

func (form KVSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string) (isSet bool, err error)

TrySet tries to set a value by request's form source (like map[string][]string)

type KVsSource

type KVsSource map[string][]string

func (KVsSource) Peek

func (form KVsSource) Peek(key string) ([]string, bool)

func (KVsSource) TrySet

func (form KVsSource) TrySet(value reflect.Value, field reflect.StructField, tagValue string) (isSet bool, err error)

TrySet tries to set a value by request's form source (like map[string][]string)

type PeekV

type PeekV interface {
	Peek(key string) (string, bool)
}

type PeekVs

type PeekVs interface {
	Peek(key string) ([]string, bool)
}

type Setter

type Setter interface {
	TrySet(value reflect.Value, field reflect.StructField, key string) (isSet bool, err error)
}

Directories

Path Synopsis
Partial reference https://github.com/grafov/m3u8/blob/master/reader.go
Partial reference https://github.com/grafov/m3u8/blob/master/reader.go
protobuf
any

Jump to

Keyboard shortcuts

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