def

package
v0.1.67 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldDef

type FieldDef struct {
	LocationType LocationType
	Name         string
	JsonTag      string
	KindName     string
}

func NewFieldDef

func NewFieldDef() *FieldDef

func (*FieldDef) WithJsonTag

func (field *FieldDef) WithJsonTag(tag string) *FieldDef

func (*FieldDef) WithKindName

func (field *FieldDef) WithKindName(kindName string) *FieldDef

func (*FieldDef) WithLocationType

func (field *FieldDef) WithLocationType(locationType LocationType) *FieldDef

func (*FieldDef) WithName

func (field *FieldDef) WithName(name string) *FieldDef

type FilePart

type FilePart struct {
	Headers textproto.MIMEHeader
	Content *os.File
}

func NewFilePart

func NewFilePart(content *os.File) *FilePart

func NewFilePartWithContentType

func NewFilePartWithContentType(content *os.File, contentType string) *FilePart

func (FilePart) Write

func (f FilePart) Write(w *multipart.Writer, name string) error

type FormData

type FormData interface {
	Write(*multipart.Writer, string) error
}

type HttpRequestDef

type HttpRequestDef struct {
	Method         string
	Path           string
	ContentType    string
	RequestFields  []*FieldDef
	ResponseFields []*FieldDef
	Response       interface{}
}

type HttpRequestDefBuilder

type HttpRequestDefBuilder struct {
	// contains filtered or unexported fields
}

func NewHttpRequestDefBuilder

func NewHttpRequestDefBuilder() *HttpRequestDefBuilder

func (*HttpRequestDefBuilder) Build

func (builder *HttpRequestDefBuilder) Build() *HttpRequestDef

func (*HttpRequestDefBuilder) WithContentType

func (builder *HttpRequestDefBuilder) WithContentType(contentType string) *HttpRequestDefBuilder

func (*HttpRequestDefBuilder) WithMethod

func (builder *HttpRequestDefBuilder) WithMethod(method string) *HttpRequestDefBuilder

func (*HttpRequestDefBuilder) WithPath

func (builder *HttpRequestDefBuilder) WithPath(path string) *HttpRequestDefBuilder

func (*HttpRequestDefBuilder) WithRequestField

func (builder *HttpRequestDefBuilder) WithRequestField(field *FieldDef) *HttpRequestDefBuilder

func (*HttpRequestDefBuilder) WithResponse

func (builder *HttpRequestDefBuilder) WithResponse(response interface{}) *HttpRequestDefBuilder

func (*HttpRequestDefBuilder) WithResponseField

func (builder *HttpRequestDefBuilder) WithResponseField(field *FieldDef) *HttpRequestDefBuilder

type LocationType

type LocationType int32
const (
	Header LocationType = 1 << iota
	Path
	Query
	Body
	Form
	Cname
)

type MultiPart

type MultiPart struct {
	Content interface{}
}

func NewMultiPart

func NewMultiPart(content interface{}) *MultiPart

func (MultiPart) Write

func (m MultiPart) Write(w *multipart.Writer, name string) error

Jump to

Keyboard shortcuts

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