binding

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 19 Imported by: 40

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 EncodeURL

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

EncodeURL encode proto message to url path.

Types

type HelloRequest added in v1.0.1

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 added in v1.0.1

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName added in v1.0.1

func (x *HelloRequest) GetName() string

func (*HelloRequest) GetSub added in v1.0.1

func (x *HelloRequest) GetSub() *Sub

func (*HelloRequest) ProtoMessage added in v1.0.1

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect added in v1.0.1

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

func (*HelloRequest) Reset added in v1.0.1

func (x *HelloRequest) Reset()

func (*HelloRequest) String added in v1.0.1

func (x *HelloRequest) String() string

type Sub added in v1.0.1

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

func (*Sub) Descriptor deprecated added in v1.0.1

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

Deprecated: Use Sub.ProtoReflect.Descriptor instead.

func (*Sub) GetName added in v1.0.1

func (x *Sub) GetName() string

func (*Sub) ProtoMessage added in v1.0.1

func (*Sub) ProtoMessage()

func (*Sub) ProtoReflect added in v1.0.1

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

func (*Sub) Reset added in v1.0.1

func (x *Sub) Reset()

func (*Sub) String added in v1.0.1

func (x *Sub) String() string

Jump to

Keyboard shortcuts

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