dataflow

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultipartHelper

func NewMultipartHelper() contract.MultipartDfInterface

Types

type Dataflow

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

func NewDataflow

func NewDataflow(client contract.ClientInterface, middlewareHandle contract.RequestMiddleware, option *Option) *Dataflow

func (*Dataflow) Any

func (*Dataflow) Body

func (*Dataflow) Err

func (d *Dataflow) Err() error

func (*Dataflow) Header

func (d *Dataflow) Header(key string, values ...string) contract.RequestDataflowInterface

Header 设置请求头, 对一个 Key 多次调用该方法, values 始终会被后面调用的覆盖

func (*Dataflow) Json

func (d *Dataflow) Json(jsonAny interface{}) contract.RequestDataflowInterface

func (*Dataflow) Method

func (*Dataflow) Multipart

func (d *Dataflow) Multipart(multipartDf func(multipart contract.MultipartDfInterface)) contract.RequestDataflowInterface

func (*Dataflow) Query

func (d *Dataflow) Query(key string, values ...string) contract.RequestDataflowInterface

func (*Dataflow) Request

func (d *Dataflow) Request() (response *http.Response, err error)

func (*Dataflow) RequestResHelper

func (d *Dataflow) RequestResHelper() (response contract.ResponseHelper, err error)

func (*Dataflow) Result

func (d *Dataflow) Result(result interface{}) (err error)

Result 实现了 Json 解码

func (*Dataflow) Uri

Uri 请注意 Url 与 Uri 方法是冲突的, Uri方法将 Uri 拼接在 BaseUrl 之后

func (*Dataflow) Url

func (d *Dataflow) Url(requestUrl string) contract.RequestDataflowInterface

func (*Dataflow) WithContext

func (*Dataflow) Xml

func (d *Dataflow) Xml(xmlAny interface{}) contract.RequestDataflowInterface

type MultipartDf

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

func (*MultipartDf) Boundary

func (*MultipartDf) Close

func (m *MultipartDf) Close() error

func (*MultipartDf) Err

func (m *MultipartDf) Err() error

func (*MultipartDf) Field

func (m *MultipartDf) Field(fieldName string, reader io.Reader) contract.MultipartDfInterface

func (*MultipartDf) FieldValue

func (m *MultipartDf) FieldValue(fieldName string, value string) contract.MultipartDfInterface

func (*MultipartDf) FileByPath

func (m *MultipartDf) FileByPath(fieldName string, filePath string) contract.MultipartDfInterface

func (*MultipartDf) FileMem

func (m *MultipartDf) FileMem(fieldName string, fileName string, reader io.Reader) contract.MultipartDfInterface

func (*MultipartDf) GetBoundary

func (m *MultipartDf) GetBoundary() string

func (*MultipartDf) GetContentType

func (m *MultipartDf) GetContentType() string

func (*MultipartDf) GetReader

func (m *MultipartDf) GetReader() io.Reader

func (*MultipartDf) Part

type Option

type Option struct {
	BaseUrl string
}

type Response

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

func (*Response) GetBody

func (r *Response) GetBody() io.Reader

func (*Response) GetBodyBytes

func (r *Response) GetBodyBytes() ([]byte, error)

func (*Response) GetBodyJsonAsMap

func (r *Response) GetBodyJsonAsMap() (map[string]interface{}, error)

func (*Response) GetHeader

func (r *Response) GetHeader(key string) string

func (*Response) GetStatusCode

func (r *Response) GetStatusCode() int

Jump to

Keyboard shortcuts

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