collections

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddContentToCollection added in v0.3.8

func AddContentToCollection(coluuid string, contentID string, dir string, overwrite bool, db *gorm.DB, u *util.User) error

func ConstructDirectoryPath added in v0.3.8

func ConstructDirectoryPath(dir string) (string, error)

func Contains added in v0.3.8

func Contains(collection *Collection, fullPath string, db *gorm.DB) bool

Types

type CidType added in v0.2.3

type CidType string
const (
	CidTypeDir  CidType = "directory"
	CidTypeFile CidType = "file"
)

type Collection

type Collection struct {
	ID        uint      `gorm:"primarykey" json:"-"`
	CreatedAt time.Time `json:"createdAt"`

	UUID string `gorm:"index" json:"uuid"`

	Name        string `json:"name"`
	Description string `json:"description"`
	UserID      uint   `json:"userId"`
	CID         string `json:"cid"`
}

func GetCollection

func GetCollection(coluuid string, db *gorm.DB, u *util.User) (Collection, error)

type CollectionListResponse added in v0.2.3

type CollectionListResponse struct {
	Name      string      `json:"name"`
	Type      CidType     `json:"type"`
	Size      int64       `json:"size"`
	ContID    uint64      `json:"contId"`
	Cid       *util.DbCID `json:"cid,omitempty"`
	Dir       string      `json:"dir"`
	ColUuid   string      `json:"coluuid"`
	UpdatedAt time.Time   `json:"updatedAt"`
}

func GetDirectoryContents added in v0.2.3

func GetDirectoryContents(refs []util.ContentWithPath, queryDir, coluuid string) ([]*CollectionListResponse, error)

type CollectionRef

type CollectionRef struct {
	ID         uint `gorm:"primaryKey"`
	CreatedAt  time.Time
	Collection uint    `gorm:"index:,option:CONCURRENTLY;not null"`
	Content    uint64  `gorm:"index:,option:CONCURRENTLY;not null"`
	Path       *string `gorm:"null"`
}

func GetContentsInPath

func GetContentsInPath(coluuid string, path string, db *gorm.DB, u *util.User) ([]CollectionRef, error)

refs = collections.GetContentsInPath(path, s.DB, u)

Jump to

Keyboard shortcuts

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