dao

package
v0.86.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	idgen_client.IDGenClient2
	// contains filtered or unexported fields
}

func New

func New(c config.Config) *Dao

func (*Dao) FPutDocumentFile

func (d *Dao) FPutDocumentFile(ctx context.Context, path string, r string) (n int64, err error)

func (*Dao) GetCacheDfsFileInfo

func (d *Dao) GetCacheDfsFileInfo(ctx context.Context, id int64) (*model.DfsFileInfo, error)

func (*Dao) GetCacheFile

func (d *Dao) GetCacheFile(ctx context.Context, bucket string, id int64, offset int32, limit int32) (bytes []byte, err error)

func (*Dao) GetFile

func (d *Dao) GetFile(ctx context.Context, bucket, path string, offset, limit int32) (bytes []byte, err error)

func (*Dao) GetFileInfo

func (d *Dao) GetFileInfo(ctx context.Context, ownerId, fileId int64) (fileInfo *model.DfsFileInfo, err error)

func (*Dao) NewSSDBReader

func (d *Dao) NewSSDBReader(fileInfo *model.DfsFileInfo) *SSDBReader

func (*Dao) OpenFile

func (d *Dao) OpenFile(ctx context.Context, ownerId, fileId int64, parts int32) (*SSDBReader, error)

func (*Dao) PutDocumentFile

func (d *Dao) PutDocumentFile(ctx context.Context, path string, r io.Reader) (n int64, err error)

func (*Dao) PutEncryptedFile

func (d *Dao) PutEncryptedFile(ctx context.Context, path string, r io.Reader) (n int64, err error)

func (*Dao) PutPhotoFile

func (d *Dao) PutPhotoFile(ctx context.Context, path string, buf []byte) (n int64, err error)

func (*Dao) PutVideoFile

func (d *Dao) PutVideoFile(ctx context.Context, path string, buf []byte) (n int64, err error)

func (*Dao) ReadFile

func (d *Dao) ReadFile(ctx context.Context, ownerId, fileId int64, parts int32) (partLength int32, bytes []byte, err error)

func (*Dao) ReadFileCB

func (d *Dao) ReadFileCB(ctx context.Context, ownerId, fileId int64, parts int32, cb func(part int32, bytes []byte) error) (err error)

func (*Dao) ReadOffsetLimit

func (d *Dao) ReadOffsetLimit(ctx context.Context, fileInfo *model.DfsFileInfo, offset, limit int32) (bytes []byte, err error)

func (*Dao) SetCacheFileInfo

func (d *Dao) SetCacheFileInfo(ctx context.Context, id int64, dfsFileInfo *model.DfsFileInfo) (err error)

func (*Dao) SetFileInfo

func (d *Dao) SetFileInfo(ctx context.Context, fileInfo *model.DfsFileInfo) (err error)

func (*Dao) WriteFilePartData

func (d *Dao) WriteFilePartData(ctx context.Context, ownerId, fileId int64, filePart int32, bytes []byte) (err error)

type SSDBReader

type SSDBReader struct {
	*model.DfsFileInfo
	// contains filtered or unexported fields
}

func (*SSDBReader) Read

func (r *SSDBReader) Read(p []byte) (n int, err error)

func (*SSDBReader) ReadAll

func (r *SSDBReader) ReadAll(ctx context.Context) ([]byte, error)

func (*SSDBReader) Seek

func (r *SSDBReader) Seek(offset int64, whence int) (int64, error)

Seek implements the io.Seeker interface.

Directories

Path Synopsis
examples
dfs

Jump to

Keyboard shortcuts

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