binding

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProtoJSON = protoJSONBinding{}

Functions

This section is empty.

Types

type BodyRule

type BodyRule struct {
	// Name * or xxx
	Name string
	// Type string,integer,number,boolean,array,object
	Type string
}

BodyRule body

type HttpRuleBinding

type HttpRuleBinding struct {
	Path      []*PathRule
	NamedPath *NamedPathRule
	Query     []*QueryRule
	Body      *BodyRule
}

func (*HttpRuleBinding) Bind

func (b *HttpRuleBinding) Bind(ginCtx *gin.Context, req any) error

type NamedPathRule

type NamedPathRule struct {
	// Name book.name
	Name string
	// Parameters shelf,book
	Parameters []string
	// Template shelves/%s/books/%s
	Template string
}

NamedPathRule /{book.name=shelves/*/books/*} => /shelves/{shelf}/books/{book}

type PathRule

type PathRule struct {
	// Name message_id
	Name string
	// Type string,integer,number,boolean
	Type string
}

PathRule /{message_id} => /:message_id

type QueryRule

type QueryRule struct {
	// Name message_id
	Name string
	// Type string,integer,number,boolean,array
	Type string
	// ItemType
	ItemType string
}

QueryRule ?message_id=1

Jump to

Keyboard shortcuts

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