Documentation ¶
Index ¶
- Constants
- type CallbackFunc
- type ControlBlock
- func (c *ControlBlock) GetDownloadCallback(ctx context.Context) (CallbackFunc, error)
- func (c *ControlBlock) GetDownloadFileMetadata(ctx context.Context) (*FileMetadata, error)
- func (c *ControlBlock) GetUploadCallback(ctx context.Context) (CallbackFunc, error)
- func (c *ControlBlock) GetUploadFileMetadata(ctx context.Context) (*FileMetadata, error)
- func (c *ControlBlock) RegisterDownloadCallback(id DownloadCallbackID, fn CallbackFunc) *DownloadCallBack
- func (c *ControlBlock) RegisterUploadCallback(id UploadCallbackID, fn CallbackFunc) *UploadCallBack
- type DownloadCallBack
- type DownloadCallbackID
- type FileMetadata
- type FileType
- type UploadCallBack
- type UploadCallbackID
Constants ¶
View Source
const MaxFileSize = 256 << 20
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackFunc ¶ added in v0.1.4
type CallbackFunc func(context.Context, model.InternalID) error
type ControlBlock ¶
type ControlBlock struct {
// contains filtered or unexported fields
}
func NewControlBlock ¶
func NewControlBlock(a *libauth.Auth) *ControlBlock
func (*ControlBlock) GetDownloadCallback ¶ added in v0.1.4
func (c *ControlBlock) GetDownloadCallback(ctx context.Context) (CallbackFunc, error)
func (*ControlBlock) GetDownloadFileMetadata ¶ added in v0.1.4
func (c *ControlBlock) GetDownloadFileMetadata(ctx context.Context) (*FileMetadata, error)
func (*ControlBlock) GetUploadCallback ¶
func (c *ControlBlock) GetUploadCallback(ctx context.Context) (CallbackFunc, error)
func (*ControlBlock) GetUploadFileMetadata ¶
func (c *ControlBlock) GetUploadFileMetadata(ctx context.Context) (*FileMetadata, error)
func (*ControlBlock) RegisterDownloadCallback ¶ added in v0.1.4
func (c *ControlBlock) RegisterDownloadCallback(id DownloadCallbackID, fn CallbackFunc) *DownloadCallBack
func (*ControlBlock) RegisterUploadCallback ¶
func (c *ControlBlock) RegisterUploadCallback(id UploadCallbackID, fn CallbackFunc) *UploadCallBack
type DownloadCallBack ¶ added in v0.1.4
type DownloadCallBack struct {
// contains filtered or unexported fields
}
func (*DownloadCallBack) GenerateDownloadToken ¶ added in v0.1.4
func (u *DownloadCallBack) GenerateDownloadToken(ctx context.Context, meta FileMetadata, expire time.Duration) (string, error)
type DownloadCallbackID ¶ added in v0.1.4
type DownloadCallbackID int
const (
DownloadEmpty DownloadCallbackID = iota
)
type FileMetadata ¶
type FileMetadata struct { ID model.InternalID `json:"id,string"` Name string SizeBytes int64 Type FileType Sha256 []byte }
func (FileMetadata) Check ¶
func (f FileMetadata) Check() error
type UploadCallBack ¶
type UploadCallBack struct {
// contains filtered or unexported fields
}
func (*UploadCallBack) GenerateUploadToken ¶
func (u *UploadCallBack) GenerateUploadToken(ctx context.Context, meta FileMetadata, expire time.Duration) (string, error)
type UploadCallbackID ¶
type UploadCallbackID int
const ( UploadEmpty UploadCallbackID = iota UploadArtifacts UploadChesedImage )
Click to show internal directories.
Click to hide internal directories.