Documentation ¶
Index ¶
- Constants
- func GetMD5Hash(text string) string
- type Addition
- type AuthService
- type Common
- type Files
- type FilesList
- type HalalCloud
- func (d *HalalCloud) Config() driver.Config
- func (d *HalalCloud) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *HalalCloud) Drop(ctx context.Context) error
- func (d *HalalCloud) GetAddition() driver.Additional
- func (d *HalalCloud) GetCurrentDir(dir model.Obj) string
- func (d *HalalCloud) GetCurrentOpDir(dir model.Obj, args []string, index int) string
- func (d *HalalCloud) Init(ctx context.Context) error
- func (d *HalalCloud) IsLogin() bool
- func (d *HalalCloud) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *HalalCloud) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *HalalCloud) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
- func (d *HalalCloud) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *HalalCloud) NewAuthService(refreshToken string, options ...HalalOption) (*AuthService, error)
- func (d *HalalCloud) NewAuthServiceWithOauth(options ...HalalOption) (*AuthService, error)
- func (d *HalalCloud) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) (model.Obj, error)
- func (d *HalalCloud) Remove(ctx context.Context, obj model.Obj) error
- func (d *HalalCloud) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
- func (d *HalalCloud) SetTokenResp(tr *TokenResp)
- type HalalCommon
- type HalalOption
- type ListInfo
- type OrderByInfo
- type SteamFile
- type TokenResp
- type UserInfo
Constants ¶
View Source
const ( AppID = "alist/10001" AppVersion = "1.0.0" AppSecret = "bR4SJwOkvnG5WvVJ" )
Variables ¶
This section is empty.
Functions ¶
func GetMD5Hash ¶
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 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) GetAddition ¶
func (d *HalalCloud) GetAddition() driver.Additional
func (*HalalCloud) GetCurrentDir ¶
func (d *HalalCloud) GetCurrentDir(dir model.Obj) string
func (*HalalCloud) GetCurrentOpDir ¶
func (*HalalCloud) IsLogin ¶
func (d *HalalCloud) IsLogin() bool
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) 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 ¶
Click to show internal directories.
Click to hide internal directories.