image

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PRBackend = new(PR)
	PRFinder  = regexp.MustCompile(`og:image" content="(.*?)"`)
)
View Source
var (
	Dest    string
	Backend string
	Verbose bool
)
View Source
var (
	AliBackend = new(Ali)
)
View Source
var (
	BDBackend = new(BD)
)
View Source
var (
	CCBackend = new(CC)
)
View Source
var (
	CheveretoBackend = new(Chevereto)
)
View Source
var (
	IKrBackend = new(IKr)
)
View Source
var (
	IUBackend = new(IU)
)
View Source
var (
	ImgBoxBackend = new(ImgBox)
)
View Source
var (
	ItpBackend = new(Itp)
)
View Source
var (
	JJBackend = new(JJ)
)
View Source
var (
	NTBackend = new(NT)
)
View Source
var (
	SGBackend = new(SG)
)
View Source
var (
	SMBackend = new(SM)
)
View Source
var (
	SNBackend = new(SN)
)
View Source
var (
	TGBackend = new(TG)
)
View Source
var (
	TTBackend = new(TT)
)
View Source
var (
	VMBackend = new(VM)
)
View Source
var (
	XMBackend = new(XM)
)

Functions

func InitCmd

func InitCmd(cmd *cobra.Command)

func NewWriter

func NewWriter(w io.Writer) *mWriter

func Upload

func Upload(file []string)

Types

type Ali

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

func (Ali) DownloadStream

func (s Ali) DownloadStream(chan DownloadDataFlow)

func (Ali) Upload

func (s Ali) Upload(data []byte) (string, error)

func (Ali) UploadStream

func (s Ali) UploadStream(chan UploadDataFlow)

type AliResp

type AliResp struct {
	Code string `json:"code"`
	Url  string `json:"url"`
	Hash string `json:"hash"`
}

type BD

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

func (BD) DownloadStream

func (s BD) DownloadStream(chan DownloadDataFlow)

func (BD) Upload

func (s BD) Upload(data []byte) (string, error)

func (BD) UploadStream

func (s BD) UploadStream(chan UploadDataFlow)

type BDItem

type BDItem struct {
	Sign string `json:"sign"`
}

type BDResp

type BDResp struct {
	Message string `json:"msg"`
	Data    BDItem `json:"data"`
}

type CC

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

func (CC) DownloadStream

func (s CC) DownloadStream(chan DownloadDataFlow)

func (CC) ModBuilder

func (s CC) ModBuilder(ck *http.Cookie) func(*http.Request)

func (CC) Upload

func (s CC) Upload(data []byte) (string, error)

func (CC) UploadStream

func (s CC) UploadStream(chan UploadDataFlow)

type CCImageItem

type CCImageItem struct {
	URL string `json:"url"`
	Del string `json:"delete"`
}

type CCResp

type CCResp struct {
	Code   int64         `json:"code"`
	Errors int64         `json:"total_error"`
	Image  []CCImageItem `json:"success_image"`
}

type Chevereto

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

func (Chevereto) DownloadStream

func (s Chevereto) DownloadStream(chan DownloadDataFlow)

func (Chevereto) Upload

func (s Chevereto) Upload(data []byte) (string, error)

func (Chevereto) UploadStream

func (s Chevereto) UploadStream(chan UploadDataFlow)

type CheveretoResp

type CheveretoResp struct {
	StatusCode int `json:"status_code"`
	Image      struct {
		Name string `json:"name"`
		URL  string `json:"url"`
	} `json:"image"`

	Error struct {
		Message string `json:"message"`
		ErrorID string `json:"errorId"`
		Code    int    `json:"code"`
	} `json:"error"`
	StatusTxt string `json:"status_txt"`
}

type DownloadDataFlow

type DownloadDataFlow struct {
	Wg     *sync.WaitGroup
	File   *os.File
	Bar    *pb.ProgressBar
	Hash   string
	Offset string
}

type IKr

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

func (IKr) DownloadStream

func (s IKr) DownloadStream(chan DownloadDataFlow)

func (IKr) Upload

func (s IKr) Upload(data []byte) (string, error)

func (IKr) UploadStream

func (s IKr) UploadStream(chan UploadDataFlow)

type IKrResp

type IKrResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Success bool   `json:"success"`
	Data    string `json:"data"`
}

type IU

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

func (IU) DownloadStream

func (s IU) DownloadStream(chan DownloadDataFlow)

func (IU) Upload

func (s IU) Upload(data []byte) (string, error)

func (IU) UploadStream

func (s IU) UploadStream(chan UploadDataFlow)

type IUResp

type IUResp struct {
	Code         int    `json:"code"`
	ID           int    `json:"id"`
	Imgid        string `json:"imgid"`
	RelativePath string `json:"relative_path"`
	URL          string `json:"url"`
	ThumbnailURL string `json:"thumbnail_url"`
	Width        int    `json:"width"`
	Height       int    `json:"height"`
	Delete       string `json:"delete"`
}

type ImgBox

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

func (ImgBox) DownloadStream

func (s ImgBox) DownloadStream(chan DownloadDataFlow)

func (ImgBox) Upload

func (s ImgBox) Upload(data []byte) (string, error)

func (ImgBox) UploadStream

func (s ImgBox) UploadStream(chan UploadDataFlow)

type ImgBoxResp

type ImgBoxResp struct {
	Files []struct {
		ID              string    `json:"id"`
		Slug            string    `json:"slug"`
		Name            string    `json:"name"`
		NameHTMLEscaped string    `json:"name_html_escaped"`
		CreatedAt       time.Time `json:"created_at"`
		CreatedAtHuman  string    `json:"created_at_human"`
		UpdatedAt       time.Time `json:"updated_at"`
		GalleryID       any       `json:"gallery_id"`
		URL             string    `json:"url"`
		OriginalURL     string    `json:"original_url"`
		ThumbnailURL    string    `json:"thumbnail_url"`
		SquareURL       string    `json:"square_url"`
		Selected        bool      `json:"selected"`
		CommentsEnabled int       `json:"comments_enabled"`
		CommentsCount   int       `json:"comments_count"`
	} `json:"files"`
}

type ImgBoxTokenResp

type ImgBoxTokenResp struct {
	Ok            bool   `json:"ok"`
	TokenID       int    `json:"token_id"`
	TokenSecret   string `json:"token_secret"`
	GalleryID     string `json:"gallery_id"`
	GallerySecret string `json:"gallery_secret"`
}

type Itp

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

func (Itp) DownloadStream

func (s Itp) DownloadStream(chan DownloadDataFlow)

func (Itp) Upload

func (s Itp) Upload(data []byte) (string, error)

func (Itp) UploadStream

func (s Itp) UploadStream(chan UploadDataFlow)

type ItpResp

type ItpResp struct {
	Code int64 `json:"code"`
	Data struct {
		ID   string `json:"id"`
		Md5  string `json:"md5"`
		Mime string `json:"mime"`
		Name string `json:"name"`
		Sha1 string `json:"sha1"`
		Size int64  `json:"size"`
		URL  string `json:"url"`
	} `json:"data"`
	Msg  string `json:"msg"`
	Time int64  `json:"time"`
}

type JJ

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

func (JJ) DownloadStream

func (s JJ) DownloadStream(chan DownloadDataFlow)

func (JJ) Upload

func (s JJ) Upload(data []byte) (string, error)

func (JJ) UploadStream

func (s JJ) UploadStream(chan UploadDataFlow)

type JJCol

type JJCol struct {
	URL JJItem `json:"url"`
}

type JJItem

type JJItem struct {
	Http  string `json:"http"`
	Https string `json:"https"`
}

type JJResp

type JJResp struct {
	Code int   `json:"s"`
	D    JJCol `json:"d"`
}

type NT

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

func (NT) DownloadStream

func (s NT) DownloadStream(chan DownloadDataFlow)

func (NT) Upload

func (s NT) Upload(data []byte) (string, error)

func (NT) UploadStream

func (s NT) UploadStream(chan UploadDataFlow)

type NTResp

type NTResp struct {
	Code  string   `json:"code"`
	Error string   `json:"errorCode"`
	Data  []string `json:"data"`
}

type PR

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

func (PR) DownloadStream

func (s PR) DownloadStream(chan DownloadDataFlow)

func (PR) Upload

func (s PR) Upload(data []byte) (string, error)

func (PR) UploadStream

func (s PR) UploadStream(chan UploadDataFlow)

type PRResp

type PRResp struct {
	Code string `json:"status"`
	Data string `json:"data"`
}

type PicBed

type PicBed interface {
	Upload([]byte) (string, error)
	UploadStream(chan UploadDataFlow)     // optional
	DownloadStream(chan DownloadDataFlow) // optional
}

func ParseBackend

func ParseBackend(sp string) PicBed

type SG

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

func (SG) DownloadStream

func (s SG) DownloadStream(chan DownloadDataFlow)

func (SG) Upload

func (s SG) Upload(data []byte) (string, error)

func (SG) UploadStream

func (s SG) UploadStream(chan UploadDataFlow)

type SM

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

func (SM) DownloadStream

func (s SM) DownloadStream(chan DownloadDataFlow)

func (SM) Upload

func (s SM) Upload(data []byte) (string, error)

func (SM) UploadStream

func (s SM) UploadStream(chan UploadDataFlow)

type SMItem

type SMItem struct {
	URL string `json:"url"`
}

type SMResp

type SMResp struct {
	Code  string `json:"code"`
	Error string `json:"message"`
	Data  SMItem `json:"data"`
}

type SN

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

func (SN) DownloadStream

func (s SN) DownloadStream(chan DownloadDataFlow)

func (SN) Upload

func (s SN) Upload(data []byte) (string, error)

func (SN) UploadStream

func (s SN) UploadStream(chan UploadDataFlow)

type SNResp

type SNResp struct {
	Url string `json:"src"`
}

type TG

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

func (TG) DownloadStream

func (s TG) DownloadStream(chan DownloadDataFlow)

func (TG) Upload

func (s TG) Upload(data []byte) (string, error)

func (TG) UploadStream

func (s TG) UploadStream(chan UploadDataFlow)

type TT

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

func (TT) DownloadStream

func (s TT) DownloadStream(chan DownloadDataFlow)

func (TT) Upload

func (s TT) Upload(data []byte) (string, error)

func (TT) UploadStream

func (s TT) UploadStream(chan UploadDataFlow)

type TTResp

type TTResp struct {
	Code string `json:"message"`
	D    string `json:"web_url"`
}

type UploadDataFlow

type UploadDataFlow struct {
	Wg      *sync.WaitGroup
	Data    []byte
	Offset  int64
	HashMap *cmap.ConcurrentMap
}

type VM

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

func (VM) DownloadStream

func (s VM) DownloadStream(chan DownloadDataFlow)

func (VM) Upload

func (s VM) Upload(data []byte) (string, error)

func (VM) UploadStream

func (s VM) UploadStream(chan UploadDataFlow)

type XM

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

func (XM) DownloadStream

func (s XM) DownloadStream(chan DownloadDataFlow)

func (XM) Upload

func (s XM) Upload(data []byte) (string, error)

func (XM) UploadStream

func (s XM) UploadStream(chan UploadDataFlow)

type XMResp

type XMResp struct {
	Code string `json:"message"`
	D    string `json:"result"`
}

Jump to

Keyboard shortcuts

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