client

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Those file operate is so big that I extract them from utils.go

Index

Constants

This section is empty.

Variables

View Source
var ErrUnexpectRespStatus = errors.New("this response status code isn't ok")

Functions

func DetectAndConcatFileUrl added in v0.4.0

func DetectAndConcatFileUrl(conf *model.Conf, clipboard *model.Clipboard) string

if this clipboard content is a binary file, return the download url

func DownloadFile

func DownloadFile(requiredFileName string, client *http.Client, c *model.Conf, logger *logrus.Entry)

func ExtractErrorMsg

func ExtractErrorMsg(body []byte) (string, error)

func GenClipboardReqBody

func GenClipboardReqBody(c string) ([]byte, *model.Clipboard, error)

return the marshaled request body and the raw clipboard struct

func Instant

func Instant(c *model.Conf)

func NewUClipboardHttpClient

func NewUClipboardHttpClient(c *model.Conf) *http.Client

func ParsePullData

func ParsePullData(body []byte) (remoteClipboards []model.Clipboard, err error)

func ParseUploadInfomation

func ParseUploadInfomation(body []byte) (info map[string]interface{}, err error)

func Run

func Run(c *model.Conf)

func SendPullReq

func SendPullReq(client *http.Client, c *model.Conf) ([]byte, error)

func SendPushReq

func SendPushReq(s string, client *http.Client, c *model.Conf) (*model.Clipboard, error)

func UploadFile

func UploadFile(filePath string, client *http.Client, c *model.Conf, logger *logrus.Entry)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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