Documentation ¶
Index ¶
- func Bool(val string) (bool, error)
- func BoolSlice(val, sep string) ([]bool, error)
- func BoolValue(val string) (*wrapperspb.BoolValue, error)
- func Bytes(val string) ([]byte, error)
- func BytesSlice(val, sep string) ([][]byte, error)
- func BytesValue(val string) (*wrapperspb.BytesValue, error)
- func DoubleValue(val string) (*wrapperspb.DoubleValue, error)
- func Duration(val string) (*durationpb.Duration, error)
- func Enum(val string, enumValMap map[string]int32) (int32, error)
- func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error)
- func Float32(val string) (float32, error)
- func Float32Slice(val, sep string) ([]float32, error)
- func Float64(val string) (float64, error)
- func Float64Slice(val, sep string) ([]float64, error)
- func FloatValue(val string) (*wrapperspb.FloatValue, error)
- func Int32(val string) (int32, error)
- func Int32Slice(val, sep string) ([]int32, error)
- func Int32Value(val string) (*wrapperspb.Int32Value, error)
- func Int64(val string) (int64, error)
- func Int64Slice(val, sep string) ([]int64, error)
- func Int64Value(val string) (*wrapperspb.Int64Value, error)
- func String(val string) (string, error)
- func StringSlice(val, sep string) ([]string, error)
- func StringValue(val string) (*wrapperspb.StringValue, error)
- func Timestamp(val string) (*timestamppb.Timestamp, error)
- func UInt32Value(val string) (*wrapperspb.UInt32Value, error)
- func UInt64Value(val string) (*wrapperspb.UInt64Value, error)
- func Uint32(val string) (uint32, error)
- func Uint32Slice(val, sep string) ([]uint32, error)
- func Uint64(val string) (uint64, error)
- func Uint64Slice(val, sep string) ([]uint64, error)
- type Decoder
- type DecoderFunc
- type Encoder
- type EncoderFunc
- type FormCodec
- type FormMarshaler
- type Marshaler
- type UriEncoder
- type UriMarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolSlice ¶
BoolSlice converts 'val' where individual booleans are separated by 'sep' into a bool slice.
func BoolValue ¶
func BoolValue(val string) (*wrapperspb.BoolValue, error)
BoolValue well-known type support as wrapper around bool type
func Bytes ¶
Bytes converts the given string representation of a byte sequence into a slice of bytes A bytes sequence is encoded in URL-safe base64 without padding
func BytesSlice ¶
BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe base64 without padding, are separated by 'sep' into a slice of bytes slices slice.
func BytesValue ¶
func BytesValue(val string) (*wrapperspb.BytesValue, error)
BytesValue well-known type support as wrapper around bytes[] type
func DoubleValue ¶
func DoubleValue(val string) (*wrapperspb.DoubleValue, error)
DoubleValue well-known type support as wrapper around float64 type
func Duration ¶
func Duration(val string) (*durationpb.Duration, error)
Duration converts the given string into a timestamp.Duration.
func Enum ¶
Enum converts the given string into an int32 that should be type casted into the correct enum proto type.
func EnumSlice ¶
EnumSlice converts 'val' where individual enums are separated by 'sep' into a int32 slice. Each individual int32 should be type casted into the correct enum proto type.
func Float32 ¶
Float32 converts the given string representation of a floating point number into float32.
func Float32Slice ¶
Float32Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float32 slice.
func Float64 ¶
Float64 converts the given string representation into representation of a floating point number into float64.
func Float64Slice ¶
Float64Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float64 slice.
func FloatValue ¶
func FloatValue(val string) (*wrapperspb.FloatValue, error)
FloatValue well-known type support as wrapper around float32 type
func Int32Slice ¶
Int32Slice converts 'val' where individual integers are separated by 'sep' into a int32 slice.
func Int32Value ¶
func Int32Value(val string) (*wrapperspb.Int32Value, error)
Int32Value well-known type support as wrapper around int32 type
func Int64Slice ¶
Int64Slice converts 'val' where individual integers are separated by 'sep' into a int64 slice.
func Int64Value ¶
func Int64Value(val string) (*wrapperspb.Int64Value, error)
Int64Value well-known type support as wrapper around int64 type
func StringSlice ¶
StringSlice converts 'val' where individual strings are separated by 'sep' into a string slice.
func StringValue ¶
func StringValue(val string) (*wrapperspb.StringValue, error)
StringValue well-known type support as wrapper around string type
func Timestamp ¶
func Timestamp(val string) (*timestamppb.Timestamp, error)
Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp.
func UInt32Value ¶
func UInt32Value(val string) (*wrapperspb.UInt32Value, error)
UInt32Value well-known type support as wrapper around uint32 type
func UInt64Value ¶
func UInt64Value(val string) (*wrapperspb.UInt64Value, error)
UInt64Value well-known type support as wrapper around uint64 type
func Uint32Slice ¶
Uint32Slice converts 'val' where individual integers are separated by 'sep' into a uint32 slice.
func Uint64Slice ¶
Uint64Slice converts 'val' where individual integers are separated by 'sep' into a uint64 slice.
Types ¶
type DecoderFunc ¶
DecoderFunc adapts an decoder function into Decoder.
func (DecoderFunc) Decode ¶
func (f DecoderFunc) Decode(v any) error
Decode delegates invocations to the underlying function itself.
type EncoderFunc ¶
EncoderFunc adapts an encoder function into Encoder
func (EncoderFunc) Encode ¶
func (f EncoderFunc) Encode(v any) error
Encode delegates invocations to the underlying function itself.
type FormMarshaler ¶
FormMarshaler defines a conversion between byte sequence and gRPC payloads / fields.
type Marshaler ¶
type Marshaler interface { // ContentType returns the Content-Type which this marshaler is responsible for. // The parameter describes the type which is being marshalled, which can sometimes // affect the content type returned. ContentType(v any) string // Marshal marshals "v" into byte sequence. Marshal(v any) ([]byte, error) // Unmarshal unmarshals "data" into "v". // "v" must be a pointer value. Unmarshal(data []byte, v any) error // NewDecoder returns a Decoder which reads byte sequence from "r". NewDecoder(r io.Reader) Decoder // NewEncoder returns an Encoder which writes bytes sequence into "w". NewEncoder(w io.Writer) Encoder }
Marshaler defines a conversion between byte sequence and gRPC payloads / fields.
type UriEncoder ¶
type UriEncoder interface { // EncodeURL encode v to url path. // pathTemplate is a template of url path like http://helloworld.dev/{name}/sub/{sub.name}, EncodeURL(pathTemplate string, v any, needQuery bool) string }
UriEncoder encode to url path
type UriMarshaler ¶
type UriMarshaler interface { Marshaler FormCodec UriEncoder }
UriMarshaler defines a conversion between byte sequence and gRPC payloads / fields.