model

package
v0.2.2-0...-6c0b2be Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PHASE_EXPLORE  = "PHASE_EXPLORE"
	PHASE_INDEXING = "PHASE_INDEXING"
	PHASE_MAINTAIN = "PHASE_MAINTAIN"
	PHASE_PAUSE    = "PHASE_PAUSE"
	MAX_HEAP_SIZE  = 100000
)
View Source
const DAVCachePath = "data/cache/webdav/"

Variables

View Source
var (
	SEARCH_ENABLE      func() bool
	SEARCH_PROCESS_MAX func() int
	SEARCH_PROCESS_PAR func() int
	SEARCH_REINDEX     func() int
	CYCLE_TIME         func() int
	INDEXING_EXT       func() string
	MAX_INDEXING_FSIZE func() int
	INDEXING_EXCLUSION = []string{"/node_modules/", "/bower_components/", "/.cache/", "/.npm/", "/.git/"}
)
View Source
var DB *sql.DB

Functions

func CanEdit

func CanEdit(ctx *App) bool

func CanRead

func CanRead(ctx *App) bool

func CanShare

func CanShare(ctx *App) bool

func CanUpload

func CanUpload(ctx *App) bool

func GetHome

func GetHome(b IBackend, base string) (string, error)

func MapStringInterfaceToMapStringString

func MapStringInterfaceToMapStringString(m map[string]interface{}) map[string]string

func NewBackend

func NewBackend(ctx *App, conn map[string]string) (IBackend, error)

func NewWebdavLock

func NewWebdavLock() webdav.LockSystem
func Search(app *App, path string, keyword string) []File

func ShareDelete

func ShareDelete(id string) error

func ShareGet

func ShareGet(id string) (Share, error)

func ShareList

func ShareList(backend string, path string) ([]Share, error)

func ShareProofVerifierEmail

func ShareProofVerifierEmail(users string, wanted string) (string, bool)

func ShareProofVerifierPassword

func ShareProofVerifierPassword(hashed string, given string) (string, bool)

func ShareUpsert

func ShareUpsert(p *Share) error

func TmplEmailVerification

func TmplEmailVerification() string

Types

type Document

type Document struct {
	Hash        string    `json:"-"`
	Type        string    `json:"type"`
	Name        string    `json:"name"`
	Path        string    `json:"path"`
	InitialPath string    `json:"-"`
	Ext         string    `json:"ext"`
	ModTime     time.Time `json:"time"`
	Size        int64     `json:"size"`
	Content     []byte    `json:"content"`
	Priority    int       `json:"-"`
}

type HeapDoc

type HeapDoc []*Document

https://golang.org/pkg/container/heap/

func (HeapDoc) Len

func (h HeapDoc) Len() int

func (HeapDoc) Less

func (h HeapDoc) Less(i, j int) bool

func (*HeapDoc) Pop

func (h *HeapDoc) Pop() interface{}

func (*HeapDoc) Push

func (h *HeapDoc) Push(x interface{})

func (HeapDoc) Swap

func (h HeapDoc) Swap(i, j int)

type Proof

type Proof struct {
	Id      string  `json:"id"`
	Key     string  `json:"key"`
	Value   string  `json:"-"`
	Message *string `json:"message,omitempty"`
	Error   *string `json:"error,omitempty"`
}

func ShareProofCalculateRemainings

func ShareProofCalculateRemainings(ref []Proof, mem []Proof) []Proof

func ShareProofGetAlreadyVerified

func ShareProofGetAlreadyVerified(req *http.Request) []Proof

func ShareProofGetRequired

func ShareProofGetRequired(s Share) []Proof

func ShareProofVerifier

func ShareProofVerifier(s Share, proof Proof) (Proof, error)

type SearchIndexer

type SearchIndexer struct {
	Id             string
	FoldersUnknown HeapDoc
	CurrentPhase   string
	Backend        IBackend
	DBPath         string
	DB             *sql.DB
	// contains filtered or unexported fields
}

func NewSearchIndexer

func NewSearchIndexer(id string, b IBackend) SearchIndexer

func (*SearchIndexer) Consolidate

func (this *SearchIndexer) Consolidate(tx *sql.Tx) bool

func (*SearchIndexer) Discover

func (this *SearchIndexer) Discover(tx *sql.Tx) bool

func (*SearchIndexer) Execute

func (this *SearchIndexer) Execute()

func (*SearchIndexer) Indexing

func (this *SearchIndexer) Indexing(tx *sql.Tx) bool

type SearchProcess

type SearchProcess struct {
	// contains filtered or unexported fields
}
var SProc SearchProcess = SearchProcess{
	// contains filtered or unexported fields
}

func (*SearchProcess) HintFile

func (this *SearchProcess) HintFile(app *App, path string)

func (*SearchProcess) HintLs

func (this *SearchProcess) HintLs(app *App, path string) *SearchIndexer

func (*SearchProcess) HintRm

func (this *SearchProcess) HintRm(app *App, path string)

func (*SearchProcess) Peek

func (this *SearchProcess) Peek() *SearchIndexer

func (*SearchProcess) Reset

func (this *SearchProcess) Reset()

type WebdavFile

type WebdavFile struct {
	// contains filtered or unexported fields
}

* Implement a webdav.File and os.Stat : https://godoc.org/golang.org/x/net/webdav#File

func (*WebdavFile) Close

func (this *WebdavFile) Close() error

func (WebdavFile) ETag

func (this WebdavFile) ETag(ctx context.Context) (string, error)

func (WebdavFile) IsDir

func (this WebdavFile) IsDir() bool

func (WebdavFile) ModTime

func (this WebdavFile) ModTime() time.Time

func (WebdavFile) Mode

func (this WebdavFile) Mode() os.FileMode

func (WebdavFile) Name

func (this WebdavFile) Name() string

func (*WebdavFile) Read

func (this *WebdavFile) Read(p []byte) (n int, err error)

func (*WebdavFile) Readdir

func (this *WebdavFile) Readdir(count int) ([]os.FileInfo, error)

func (*WebdavFile) Seek

func (this *WebdavFile) Seek(offset int64, whence int) (int64, error)

func (*WebdavFile) Size

func (this *WebdavFile) Size() int64

func (*WebdavFile) Stat

func (this *WebdavFile) Stat() (os.FileInfo, error)

func (WebdavFile) Sys

func (this WebdavFile) Sys() interface{}

func (*WebdavFile) Write

func (this *WebdavFile) Write(p []byte) (int, error)

type WebdavFs

type WebdavFs struct {
	// contains filtered or unexported fields
}

func NewWebdavFs

func NewWebdavFs(b IBackend, primaryKey string, chroot string, req *http.Request) *WebdavFs

func (WebdavFs) Mkdir

func (this WebdavFs) Mkdir(ctx context.Context, name string, perm os.FileMode) error

func (*WebdavFs) OpenFile

func (this *WebdavFs) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error)

func (WebdavFs) RemoveAll

func (this WebdavFs) RemoveAll(ctx context.Context, name string) error

func (WebdavFs) Rename

func (this WebdavFs) Rename(ctx context.Context, oldName, newName string) error

func (*WebdavFs) Stat

func (this *WebdavFs) Stat(ctx context.Context, name string) (os.FileInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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