models

package
v0.0.7-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinePaths

func CombinePaths(path1, path2, sep string) string

func ConvertSizeString

func ConvertSizeString(size int64) string

func FilterStrings

func FilterStrings(arr []string, filter func(string) bool) []string

func GetFileExtension

func GetFileExtension(file string) string

func SelectStrings

func SelectStrings(arr []string, selector func(string) string) []string

func ShellMatch

func ShellMatch(str, p string) bool

func ShortPath

func ShortPath(path string, length int) string

func ShortString

func ShortString(str string, length int) string

func ToIdentity

func ToIdentity(path string) string

func ToMd5

func ToMd5(str string) string

Types

type B

type B map[string]interface{}

Request body

type Config

type Config struct {
	DownloadPath      string       `json:"downloadPath" `
	DownloadThread    int32        `json:"downloadThread"`
	DownloadBlockSize int64        `json:"downloadBlockSize"`
	Mount             *MountConfig `json:"mount"`
	Tokens            []string     `json:"tokens"`
}
var (
	DefaultConf *Config
)

func LoadConfig

func LoadConfig(file string) *Config

func (*Config) SaveFile

func (conf *Config) SaveFile(file string)

type MountConfig

type MountConfig struct {
	AllowPreload bool  `json:"allowPreload"`
	ChunkSize    int64 `json:"chunkSize"`
	ChunkMax     int64 `json:"chunkMax"`
}

type SixHttpClient

type SixHttpClient struct {
	QingzhenToken string
	// contains filtered or unexported fields
}

6盘

func NewSixHttpClient

func NewSixHttpClient(token string) *SixHttpClient

func (*SixHttpClient) GetBytes

func (cli *SixHttpClient) GetBytes(url string) ([]byte, error)

func (*SixHttpClient) GetString

func (cli *SixHttpClient) GetString(url string) string

func (*SixHttpClient) PostJson

func (cli *SixHttpClient) PostJson(url, body string) string

func (*SixHttpClient) PostJsonObject

func (cli *SixHttpClient) PostJsonObject(url string, body B) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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