storage

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataFileExt = ".metadata"
	PageFileExt     = ".pagedata"
	ContentFileExt  = ".content"
	RmFileExt       = ".rm"

	//ZipFileExt zip file extension
	ZipFileExt = ".zip"
	//EpubFileExt epub
	EpubFileExt = ".epub"
	//PdfFileExt pdf
	PdfFileExt = ".pdf"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStorage added in v0.0.5

type BlobStorage interface {
	GetBlobURL(uid, docid string, write bool) (string, time.Time, error)

	StoreBlob(uid, blobID string, s io.Reader, matchGeneration int64) (int64, error)
	LoadBlob(uid, blobID string) (reader io.ReadCloser, gen int64, size int64, err error)
	CreateBlobDocument(uid, name, parent string, stream io.Reader) (doc *Document, err error)
}

BlobStorage stuff for sync15

type Document added in v0.0.5

type Document struct {
	ID      string
	Type    common.EntryType
	Parent  string
	Name    string
	Version int
}

Document represents a document in storage

type DocumentStorer

type DocumentStorer interface {
	StoreDocument(uid, docid string, s io.ReadCloser) error
	RemoveDocument(uid, docid string) error
	GetDocument(uid, docid string) (io.ReadCloser, error)
	ExportDocument(uid, docid, outputType string, exportOption ExportOption) (io.ReadCloser, error)

	GetStorageURL(uid, docid string) (string, time.Time, error)
	CreateDocument(uid, name, parent string, stream io.Reader) (doc *Document, err error)
}

DocumentStorer stores documents

type ExportOption added in v0.0.4

type ExportOption int

ExportOption type of export

const (
	ExportWithAnnotations ExportOption = iota
	ExportOnlyAnnotations
	ExportPayload
)

type MetadataStorer added in v0.0.4

type MetadataStorer interface {
	UpdateMetadata(uid string, r *messages.RawMetadata) error
	GetAllMetadata(uid string) ([]*messages.RawMetadata, error)
	GetMetadata(uid, docid string) (*messages.RawMetadata, error)
}

MetadataStorer manages document metadata

type UserStorer added in v0.0.4

type UserStorer interface {
	GetUsers() ([]*model.User, error)
	GetUser(string) (*model.User, error)
	RegisterUser(u *model.User) error
	UpdateUser(u *model.User) error
	RemoveUser(uid string) error
}

UserStorer holds informations about users

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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