modelbinah

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 FileType

type FileType int
const (
	FileTypeUnspecified FileType = iota
	FileTypeGeburaSave
	FileTypeChesedImage
)

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
)

Jump to

Keyboard shortcuts

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