hgate

package
v0.0.0-...-898d466 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const CachedPath = "/tmp/core-"
View Source
const RDPrefix = "slink_"

Variables

View Source
var ODExpire int64 = 0
View Source
var ODToken string = ""
View Source
var RDClient *redis.Client = nil

Functions

func ConnRD

func ConnRD()

func DrawFile

func DrawFile(path string) (string, error)

func GenerateToken

func GenerateToken() string

func GetCache

func GetCache(path string) string

func GetContentType

func GetContentType(path string) string

func GetToken

func GetToken() (string, error)

func GetV

func GetV(key string) (string, error)

func Init

func Init(prefix string) *gin.Engine

func Log

func Log(s string)

func Md5

func Md5(source string) string

func Min

func Min(a int, b int) int

func RemoveCache

func RemoveCache(path string)

func Request

func Request(method string, url string, headers map[string]string, payload []byte) ([]byte, error)

func SetCache

func SetCache(path string, data []byte)

func SetE

func SetE(key string, data string, expire string)

func SetExp

func SetExp(key string)

func SetV

func SetV(key string, data string)
func Slink(isUpload bool, path string, fh *multipart.FileHeader) (string, error)

func TestError

func TestError(data *EndPointSrv) bool

func TypeByExtension

func TypeByExtension(extension string) string

TypeByExtension returns the content type based on the extension of the file

func UploadFile

func UploadFile(path string, fh *multipart.FileHeader) (string, error)

Types

type Answer

type Answer struct {
	Type int
	Loc  string
	Data string
}

func DrawError

func DrawError(err string) *Answer

type DBModi

type DBModi struct {
	Token string          `json:"token,omitempty"`
	Data  *map[int]string `json:"data,omitempty"`
}

func FundToken

func FundToken(key string, data string) *DBModi

type DBTPush

type DBTPush struct {
	Refresh *DBModi `json:"odrefresh,omitempty"`
	Token   *DBModi `json:"odtoken,omitempty"`
	Expire  *DBModi `json:"odexpire,omitempty"`
}

type EndPointSrv

type EndPointSrv struct {
	State int      `json:"state,omitempty"`
	Type  string   `json:"type,omitempty"`
	Data  []string `json:"data,omitempty"`
}

type FileInfo

type FileInfo struct {
	Type   string    `json:"mimeType,omitempty"`
	Hashes *HashList `json:"hashes,omitempty"`
}

type HashList

type HashList struct {
	Sha1Hash string `json:"sha1Hash,omitempty"`
}

type HttpRequestFormat

type HttpRequestFormat struct {
	Query map[string]string `json:"queryStringParameters"`
}

type MSFile

type MSFile struct {
	URL  string    `json:"@microsoft.graph.downloadUrl,omitempty"`
	Time string    `json:"createdDateTime,omitempty"`
	Name string    `json:"name,omitempty"`
	Size int64     `json:"size,omitempty"`
	Info *FileInfo `json:"file,omitempty"`
}

type MSFileRes

type MSFileRes struct {
	URL  string `json:"url,omitempty"`
	Time int64  `json:"time,omitempty"`
	Name string `json:"name,omitempty"`
	Size int64  `json:"size,omitempty"`
	Type string `json:"type,omitempty"`
	Hash string `json:"hash,omitempty"`
}

type MSRespond

type MSRespond struct {
	Refresh string `json:"refresh_token,omitempty"`
	Token   string `json:"access_token,omitempty"`
	Expire  int64  `json:"expires_in,omitempty"`
}

type MultiEndPointSrv

type MultiEndPointSrv struct {
	State    int          `json:"state,omitempty"`
	Refresh  *EndPointSrv `json:"odrefresh,omitempty"`
	Token    *EndPointSrv `json:"odtoken,omitempty"`
	Expire   *EndPointSrv `json:"odexpire,omitempty"`
	ClientID *EndPointSrv `json:"clientid,omitempty"`
	Redirect *EndPointSrv `json:"redirecturi,omitempty"`
	ClientSC *EndPointSrv `json:"clientsc,omitempty"`
}

type UploaderFormat

type UploaderFormat struct {
	UploadUrl string `json:"uploadUrl"`
}

Jump to

Keyboard shortcuts

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