halalcloud

package
v3.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppID      = "alist/10001"
	AppVersion = "1.0.0"
	AppSecret  = "bR4SJwOkvnG5WvVJ"
)

Variables

This section is empty.

Functions

func GetMD5Hash

func GetMD5Hash(text string) string

Types

type Addition

type Addition struct {
	// Usually one of two
	driver.RootPath
	// define other
	RefreshToken string `json:"refresh_token" required:"true" help:"login type is refresh_token,this is required"`
	UploadThread string `json:"upload_thread" default:"3" help:"1 <= thread <= 32"`

	AppID      string `json:"app_id" required:"true" default:"alist/10001"`
	AppVersion string `json:"app_version" required:"true" default:"1.0.0"`
	AppSecret  string `json:"app_secret" required:"true" default:"bR4SJwOkvnG5WvVJ"`
}

type AuthService

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

func (*AuthService) Close

func (s *AuthService) Close()

func (*AuthService) GetGrpcConnection

func (s *AuthService) GetGrpcConnection() *grpc.ClientConn

func (*AuthService) OnAccessTokenRefreshed

func (s *AuthService) OnAccessTokenRefreshed(accessToken string, accessTokenExpiredAt int64, refreshToken string, refreshTokenExpiredAt int64)

type Common

type Common struct {
}

type Files

type Files pubUserFile.File

func (*Files) CreateTime

func (f *Files) CreateTime() time.Time

func (*Files) GetHash

func (f *Files) GetHash() utils.HashInfo

func (*Files) GetID

func (f *Files) GetID() string

func (*Files) GetName

func (f *Files) GetName() string

func (*Files) GetPath

func (f *Files) GetPath() string

func (*Files) GetSize

func (f *Files) GetSize() int64

func (*Files) IsDir

func (f *Files) IsDir() bool

func (*Files) ModTime

func (f *Files) ModTime() time.Time

type FilesList

type FilesList struct {
	Files    []*Files                `json:"files,omitempty"`
	ListInfo *common.ScanListRequest `json:"list_info,omitempty"`
}

type HalalCloud

type HalalCloud struct {
	*HalalCommon
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*HalalCloud) Config

func (d *HalalCloud) Config() driver.Config

func (*HalalCloud) Copy

func (d *HalalCloud) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*HalalCloud) Drop

func (d *HalalCloud) Drop(ctx context.Context) error

func (*HalalCloud) GetAddition

func (d *HalalCloud) GetAddition() driver.Additional

func (*HalalCloud) GetCurrentDir

func (d *HalalCloud) GetCurrentDir(dir model.Obj) string

func (*HalalCloud) GetCurrentOpDir

func (d *HalalCloud) GetCurrentOpDir(dir model.Obj, args []string, index int) string

func (*HalalCloud) Init

func (d *HalalCloud) Init(ctx context.Context) error

func (*HalalCloud) IsLogin

func (d *HalalCloud) IsLogin() bool
func (d *HalalCloud) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*HalalCloud) List

func (d *HalalCloud) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*HalalCloud) MakeDir

func (d *HalalCloud) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

func (*HalalCloud) Move

func (d *HalalCloud) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*HalalCloud) NewAuthService

func (d *HalalCloud) NewAuthService(refreshToken string, options ...HalalOption) (*AuthService, error)

func (*HalalCloud) NewAuthServiceWithOauth

func (d *HalalCloud) NewAuthServiceWithOauth(options ...HalalOption) (*AuthService, error)

func (*HalalCloud) Put

func (d *HalalCloud) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (model.Obj, error)

func (*HalalCloud) Remove

func (d *HalalCloud) Remove(ctx context.Context, obj model.Obj) error

func (*HalalCloud) Rename

func (d *HalalCloud) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

func (*HalalCloud) SetTokenResp

func (d *HalalCloud) SetTokenResp(tr *TokenResp)

type HalalCommon

type HalalCommon struct {
	*Common
	*AuthService // 登录信息
	*UserInfo    // 用户信息
	// contains filtered or unexported fields
}

type HalalOption

type HalalOption interface {
	// contains filtered or unexported methods
}

func WithGrpcDialOptions

func WithGrpcDialOptions(opts ...grpc.DialOption) HalalOption

func WithRefreshTokenRefreshedCallback

func WithRefreshTokenRefreshedCallback(s func(accessToken string, accessTokenExpiredAt int64, refreshToken string, refreshTokenExpiredAt int64)) HalalOption

type ListInfo

type ListInfo struct {
	Token   string         `json:"token,omitempty"`
	Limit   int64          `json:"limit,omitempty"`
	OrderBy []*OrderByInfo `json:"order_by,omitempty"`
	Version int32          `json:"version,omitempty"`
}

type OrderByInfo

type OrderByInfo struct {
	Field string `json:"field,omitempty"`
	Asc   bool   `json:"asc,omitempty"`
}

type SteamFile

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

func (*SteamFile) Close

func (s *SteamFile) Close() error

func (*SteamFile) Read

func (s *SteamFile) Read(p []byte) (n int, err error)

type TokenResp

type TokenResp struct {
	AccessToken           string `json:"accessToken,omitempty"`
	AccessTokenExpiredAt  int64  `json:"accessTokenExpiredAt,omitempty"`
	RefreshToken          string `json:"refreshToken,omitempty"`
	RefreshTokenExpiredAt int64  `json:"refreshTokenExpiredAt,omitempty"`
}

type UserInfo

type UserInfo struct {
	Identity string `json:"identity,omitempty"`
	UpdateTs int64  `json:"updateTs,omitempty"`
	Name     string `json:"name,omitempty"`
	CreateTs int64  `json:"createTs,omitempty"`
}

Jump to

Keyboard shortcuts

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