Versions in this module Expand all Collapse all v0 v0.0.2 Jul 5, 2023 v0.0.1 Jul 5, 2023 Changes in this version + var ErrFileExist = errors.New("file exist") + type Config struct + LocalFolderRoot string + RemoteFolderRoot string + TotalMaxSize int64 + type Dao interface + Delete func(ctx context.Context, filepathName string) error + InsertOrUpdate func(ctx context.Context, fileInfo *FileInfo) error + QueryOldest func(ctx context.Context, limit int) ([]FileInfo, error) + TotalSize func(ctx context.Context) (int64, error) + Touch func(ctx context.Context, filepathName string, date time.Time) error + type FileInfo struct + FileID string + Filepath string + LastAccess time.Time + MimeType string + Size int64 + type FileInsertInfo struct + FileBytes []byte + Filepath string + Replace bool + type GDrive struct + func New(ctx context.Context, credential json.RawMessage, config *Config, dao Dao, ...) (*GDrive, error) + func (g *GDrive) ExchangeOauthCode(code string) (*oauth2.Token, error) + func (g *GDrive) GetLoginURL() string + func (g *GDrive) Init() error + func (g *GDrive) Start() + func (g *GDrive) StoreFile(ctx context.Context, fileInsertInfo *FileInsertInfo) error + func (g *GDrive) TouchFile(ctx context.Context, filePathName string) error + func (g *GDrive) UploadAll(ctx context.Context) error + type Memory struct + func NewMemoryDao() *Memory + func (m *Memory) Delete(ctx context.Context, filepathName string) error + func (m *Memory) InsertOrUpdate(ctx context.Context, fileInfo *FileInfo) error + func (m *Memory) QueryOldest(ctx context.Context, limit int) ([]FileInfo, error) + func (m *Memory) TotalSize(ctx context.Context) (int64, error) + func (m *Memory) Touch(ctx context.Context, filepathName string, date time.Time) error