base

package
v0.0.0-...-3d980af Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Client *http.Client //HTTPClient
)

Functions

func AskFile

func AskFile(requester Request) (respStatusCode int, respBytes io.ReadCloser, respHeader http.Header, err error)

AskFile 建立http请求,返回header信息

func CheckFileRespStatus

func CheckFileRespStatus(resp *http.Response) (io.ReadCloser, http.Header, error)

CheckFileRespStatus 状态检查

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

func NewMailService

func NewMailService() *mailService

func NewUidGroup

func NewUidGroup() (map[string]*Uid, error)

Types

type Request

type Request struct {
	Url       string
	Body      io.ReadCloser
	HeaderSet map[string]string
	Method    string
	Params    map[string]string
}

type Response

type Response struct {
	Code  int             `json:"code"`
	Msg   string          `json:"message"`
	Data  json.RawMessage `json:"data"`
	Total int64           `json:"total,omitempty"`
}

func Ask

func Ask(requester Request) (respStatusCode int, respBytes *Response, respHeader http.Header, err error)

Ask 建立http请求,返回header信息

func CheckRespStatus

func CheckRespStatus(resp *http.Response) (*Response, http.Header, error)

CheckRespStatus 状态检查

type Uid

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

Uid 每个业务独立的Uid发号器

func (*Uid) NextId

func (u *Uid) NextId() (int64, error)

NextId 获取

Jump to

Keyboard shortcuts

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