library

package
v0.0.0-...-ee25e63 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Id          uint64            `json:"id"`
	Name        string            `json:"name"`
	Size        uint64            `json:"size"`
	ModTime     time.Time         `json:"modTime"`
	Author      security.Identity `json:"author"`
	ContentType string            `json:"contentType"`
	Hash        []byte            `json:"hash"`

	// LocalPath is the location on the local storage where the document
	LocalPath string `json:"localPath"`
	// TmpPath is the location for temporary readonly documents
	TmpPath string `json:"tmpPath"`
	// HasChanges is true when the location on the local storage is different than the last available on the exchange
	HasChanged bool `json:"hasChanged"`
}

Document includes information about a file stored on the library. Most information refers on the synchronized state with the exchange

type Library

type Library struct {
	Pool *pool.Pool
}

func Get

func Get(p *pool.Pool) Library

func (*Library) Accept

func (l *Library) Accept(p *pool.Pool, head pool.Head) bool

func (*Library) Download

func (l *Library) Download(id uint64, localPath string) error

func (*Library) List

func (l *Library) List(beforeId uint64, limit int) ([]Document, error)

func (*Library) TimeOffset

func (l *Library) TimeOffset(p *pool.Pool) time.Time

func (*Library) Upload

func (l *Library) Upload(id uint64) error

type State

type State int
const (
	StateSync State = iota
	StateIn
	StateOut
	StateAlt
)

Jump to

Keyboard shortcuts

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