model

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package model 请求数据模型package model

Index

Constants

View Source
const (
	// HTTPOk request succeed
	HTTPOk = 200
	// RequestErr request error
	RequestErr = 509
	// ParseError
	ParseError = 510
)

返回 code 码

View Source
const (
	FormTypeKvTable = "kvTable"
	FormParallelOk  = "parallelOk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	URL       string            // URL
	Form      string            // http/webSocket/tcp
	Method    string            // method GET/POST/PUT
	Headers   map[string]string // Headers
	Body      string            // body
	Verify    string
	Timeout   time.Duration
	Debug     bool
	MaxCon    int
	HTTP2     bool
	Keepalive bool
	Code      int // status code
}

Request request data

func NewRequestByContractType

func NewRequestByContractType(contractType string, contractMothod string) (request *Request, err error)

func (*Request) GetBody

func (r *Request) GetBody() (body io.Reader)

GetBody

type RequestResults

type RequestResults struct {
	ID            string // message ID
	ChanID        uint64 // message ID
	Time          uint64 // request time nanosecond
	IsSucceed     bool   // success ot not
	ErrCode       int    // error code
	ReceivedBytes int64
}

RequestResults

func (*RequestResults) SetID

func (r *RequestResults) SetID(chanID uint64, number uint64)

SetID Set Request ID

type Verify

type Verify interface {
	GetCode() int
	GetResult() bool // Return success or not
}

Verify 验证器

Jump to

Keyboard shortcuts

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