push_client

package
v0.0.0-...-593c55d Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"

	GET int = iota
	POST
	PUT
	DELETE
)

Variables

View Source
var (
	Methods = map[int]RequestsDoFunc{
		GET:    grequests.Get,
		POST:   grequests.Post,
		PUT:    grequests.Put,
		DELETE: grequests.Delete,
	}
	ErrRqType        = errors.New("错误的请求类型")
	ErrTimeOutHeader = errors.New("请求目标网站超时")
)

Functions

func PullHandler

func PullHandler() echo.HandlerFunc

func PushAction

func PushAction() (err error)

func RegPull

func RegPull() error

Types

type Config

type Config struct {
	ServerDomain string
	SoftDomain   string
	CallBackURI  string
	PackFiles    []string `comment:"push时打包的文件列表"`

	Soft
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

type Pull

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

func NewPull

func NewPull(link string) *Pull

func (*Pull) Download

func (p *Pull) Download() (err error)

type Push

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

type RequestFunc

type RequestFunc func(rp *grequests.Response) (e error)

type Requester

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

func NewRequester

func NewRequester() *Requester

func (*Requester) Option

func (r *Requester) Option() *grequests.RequestOptions

func (*Requester) Request

func (r *Requester) Request(method int) (err error)

func (*Requester) RequestFunc

func (r *Requester) RequestFunc() RequestFunc

func (*Requester) SetOption

func (r *Requester) SetOption(option *grequests.RequestOptions)

func (*Requester) SetRequestFunc

func (r *Requester) SetRequestFunc(requestFunc RequestFunc)

func (*Requester) SetUrl

func (r *Requester) SetUrl(url string)

func (*Requester) Url

func (r *Requester) Url() string

type RequestsDoFunc

type RequestsDoFunc func(url string, ro *grequests.RequestOptions) (rp *grequests.Response, e error)

type Soft

type Soft struct {
	Name   string
	NameCN string
	//分支
	Branch string
	//目标软件版本号
	SoftVersion string
	BinPath     string
	//安装文件路径,将软件所有文件压缩到一个zip存到服务器;统一命名为install.zip
	FullFilePath string
	//zip文件MD5验校
	HashCode string
}

Jump to

Keyboard shortcuts

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