binding

package
v2.0.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 20 Imported by: 622

Documentation

Index

Constants

This section is empty.

Variables

Functions

func BindForm

func BindForm(req *http.Request, target interface{}) error

BindForm bind form parameters to target.

func BindQuery

func BindQuery(vars url.Values, target interface{}) error

BindQuery bind vars parameters to target.

func EncodeQuery

func EncodeQuery(msg proto.Message) (url.Values, error)

EncodeQuery encode proto message to url query.

func EncodeURL

func EncodeURL(pathPattern string, msg proto.Message, needQuery bool) string

EncodeURL encode proto message to url path.

Types

type HelloRequest

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Sub  *Sub   `protobuf:"bytes,2,opt,name=sub,proto3" json:"sub,omitempty"`
	// contains filtered or unexported fields
}

The request message containing the user's name.

func (*HelloRequest) Descriptor deprecated

func (*HelloRequest) Descriptor() ([]byte, []int)

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

func (*HelloRequest) GetSub

func (x *HelloRequest) GetSub() *Sub

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

func (x *HelloRequest) ProtoReflect() protoreflect.Message

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

type Sub

type Sub struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Sub) Descriptor deprecated

func (*Sub) Descriptor() ([]byte, []int)

Deprecated: Use Sub.ProtoReflect.Descriptor instead.

func (*Sub) GetName

func (x *Sub) GetName() string

func (*Sub) ProtoMessage

func (*Sub) ProtoMessage()

func (*Sub) ProtoReflect

func (x *Sub) ProtoReflect() protoreflect.Message

func (*Sub) Reset

func (x *Sub) Reset()

func (*Sub) String

func (x *Sub) String() string

Jump to

Keyboard shortcuts

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