Documentation
¶
Index ¶
- Variables
- func Hasher256(r io.Reader) string
- func NewException(err error) *exception
- type Data
- type Info
- type Iterator
- type Object
- type ObjectStorer
- type OpErr
- type PutParam
- type QuotaInfo
- type RecordIsExist
- type ShareFunc
- type Storage
- func (o *Storage) CreateShareToken(ctx context.Context, bucket, filename string, expire time.Duration) (*Token, error)
- func (o *Storage) Delete(ctx context.Context, userID, filename string) error
- func (o *Storage) Get(ctx context.Context, bucket, filename string) (*Object, error)
- func (o *Storage) List(ctx context.Context, bucket string, limit int, lastKey string) *Iterator
- func (o *Storage) Put(ctx context.Context, param *PutParam) (*Info, error)
- func (o *Storage) WithShareToken(ctx context.Context, tknKey string) (*Object, error)
- type Token
- type TokenStorer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenExpired = errors.New("token expired") )
View Source
var ErrException = &exception{}
Functions ¶
func NewException ¶
func NewException(err error) *exception
Types ¶
type Data ¶
type Data io.ReadCloser
type Info ¶
type Info struct { Bucket string Filename string ContentType string Sum string Size int64 LastModified time.Time }
represent object
type ObjectStorer ¶
type ObjectStorer interface { Put(ctx context.Context, bucket, filename string, reader io.ReadCloser, size int64, contentType string) (*Info, error) Get(ctx context.Context, bucket, filename string) (*Object, error) Delete(ctx context.Context, bucket, filename string) error ObjectIterator(ctx context.Context, bucket string, limit int, lastFilename string) *Iterator }
type QuotaInfo ¶
func (*QuotaInfo) CheckAvail ¶
type RecordIsExist ¶
type RecordIsExist struct {
Err error
}
func (*RecordIsExist) Error ¶
func (r *RecordIsExist) Error() string
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, tokens TokenStorer, objects ObjectStorer) (*Storage, error)
func NewWithMemory ¶
func (*Storage) CreateShareToken ¶
type Token ¶
represent shareFileToken every shared file has this unique token
func (*Token) IsFilenameEqualTo ¶
func (*Token) IsNotExpire ¶
func (*Token) ValidUntil ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.