project

package
v0.0.0-...-1d800d4 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Import

func Import(ctx context.Context, db *mongo.Database, rTx, tx pgx.Tx, limit int) error

Types

type AccessSource

type AccessSource string
const (
	AccessSourceOwner  AccessSource = "owner"
	AccessSourceToken  AccessSource = "token"
	AccessSourceInvite AccessSource = "invite"
)

type AccessToken

type AccessToken string

type ActiveField

type ActiveField struct {
	Active bool `bson:"active"`
}

type ArchivedByField

type ArchivedByField struct {
	ArchivedBy Refs `bson:"archived"`
}

type AuditLogEntry

type AuditLogEntry struct {
	Info        bson.M             `bson:"info,omitempty"`
	InitiatorId primitive.ObjectID `bson:"initiatorId"`
	Operation   string             `bson:"operation"`
	Timestamp   time.Time          `bson:"timestamp"`
}

type AuditLogField

type AuditLogField struct {
	AuditLog []AuditLogEntry `bson:"auditLog"`
}

type CollaboratorRefsField

type CollaboratorRefsField struct {
	CollaboratorRefs Refs `bson:"collaberator_refs"`
}

type CommonTreeFields

type CommonTreeFields struct {
	Id   primitive.ObjectID   `bson:"_id"`
	Name sharedTypes.Filename `bson:"name"`
}

func (CommonTreeFields) GetId

type CompilerField

type CompilerField struct {
	Compiler sharedTypes.Compiler `bson:"compiler"`
}

type DeletedFile

type DeletedFile struct {
	FileRef                   `bson:"inline"`
	DeletedFileDeletedAtField `bson:"inline"`
	DeletedFileProjectIdField `bson:"inline"`
}

type DeletedFileDeletedAtField

type DeletedFileDeletedAtField struct {
	DeletedAt time.Time `bson:"deletedAt"`
}

type DeletedFileProjectIdField

type DeletedFileProjectIdField struct {
	ProjectId primitive.ObjectID `bson:"projectId"`
}

type DirWalker

type DirWalker func(folder *Folder, path sharedTypes.DirName) error

type Doc

type Doc struct {
	CommonTreeFields `bson:"inline"`

	Snapshot string
	Version  sharedTypes.Version
}

type EpochField

type EpochField struct {
	Epoch int64 `bson:"epoch"`
}

type FileRef

type FileRef struct {
	CommonTreeFields `bson:"inline"`

	LinkedFileData *LinkedFileData  `bson:"linkedFileData,omitempty"`
	Hash           sharedTypes.Hash `bson:"hash"`
	Created        time.Time        `bson:"created"`
	Size           *int64           `bson:"size"`
}

func (*FileRef) MigrateLinkedFileData

func (f *FileRef) MigrateLinkedFileData() (*project.LinkedFileData, error)

type Folder

type Folder struct {
	CommonTreeFields `bson:"inline"`

	Docs     []*Doc     `bson:"docs"`
	FileRefs []*FileRef `bson:"fileRefs"`
	Folders  []*Folder  `bson:"folders"`
}

func (*Folder) CountNodes

func (t *Folder) CountNodes() int

func (*Folder) WalkFiles

func (t *Folder) WalkFiles(fn TreeWalker) error

func (*Folder) WalkFolders

func (t *Folder) WalkFolders(fn DirWalker) error

type ForPQ

type ForPQ struct {
	ActiveField                      `bson:"inline"`
	ArchivedByField                  `bson:"inline"`
	AuditLogField                    `bson:"inline"`
	CollaboratorRefsField            `bson:"inline"`
	CompilerField                    `bson:"inline"`
	EpochField                       `bson:"inline"`
	IdField                          `bson:"inline"`
	LastUpdatedByField               `bson:"inline"`
	OwnerRefField                    `bson:"inline"`
	RootDocIdField                   `bson:"inline"`
	ImageNameField                   `bson:"inline"`
	LastOpenedField                  `bson:"inline"`
	LastUpdatedAtField               `bson:"inline"`
	NameField                        `bson:"inline"`
	PublicAccessLevelField           `bson:"inline"`
	ReadOnlyRefsField                `bson:"inline"`
	SpellCheckLanguageField          `bson:"inline"`
	TokenAccessReadAndWriteRefsField `bson:"inline"`
	TokenAccessReadOnlyRefsField     `bson:"inline"`
	TokensField                      `bson:"inline"`
	TrashedByField                   `bson:"inline"`
	TreeField                        `bson:"inline"`
	VersionField                     `bson:"inline"`
}

type IdField

type IdField struct {
	Id primitive.ObjectID `bson:"_id"`
}

type ImageNameField

type ImageNameField struct {
	ImageName sharedTypes.ImageName `bson:"imageName"`
}

type LastOpenedField

type LastOpenedField struct {
	LastOpened time.Time `bson:"lastOpened"`
}

type LastUpdatedAtField

type LastUpdatedAtField struct {
	LastUpdatedAt time.Time `bson:"lastUpdated"`
}

type LastUpdatedByField

type LastUpdatedByField struct {
	LastUpdatedBy primitive.ObjectID `bson:"lastUpdatedBy"`
}

type LinkedFileData

type LinkedFileData struct {
	Provider             project.LinkedFileProvider `bson:"provider"`
	SourceProjectId      string                     `bson:"source_project_id,omitempty"`
	SourceEntityPath     string                     `bson:"source_entity_path,omitempty"`
	SourceOutputFilePath string                     `bson:"source_output_file_path,omitempty"`
	URL                  string                     `bson:"url,omitempty"`
}

type Name

type Name string

type NameField

type NameField struct {
	Name Name `bson:"name"`
}

type OwnerRefField

type OwnerRefField struct {
	OwnerRef primitive.ObjectID `bson:"owner_ref"`
}

type PublicAccessLevel

type PublicAccessLevel string

type PublicAccessLevelField

type PublicAccessLevelField struct {
	PublicAccessLevel PublicAccessLevel `bson:"publicAccesLevel"`
}

type ReadOnlyRefsField

type ReadOnlyRefsField struct {
	ReadOnlyRefs Refs `bson:"readOnly_refs"`
}

type Refs

type Refs []primitive.ObjectID

func (Refs) Contains

func (r Refs) Contains(userId primitive.ObjectID) bool

type RootDocIdField

type RootDocIdField struct {
	RootDocId primitive.ObjectID `bson:"rootDoc_id"`
}

type SpellCheckLanguageField

type SpellCheckLanguageField struct {
	SpellCheckLanguage spellingTypes.SpellCheckLanguage `bson:"spellCheckLanguage"`
}

type TokenAccessReadAndWriteRefsField

type TokenAccessReadAndWriteRefsField struct {
	TokenAccessReadAndWriteRefs Refs `bson:"tokenAccessReadAndWrite_refs"`
}

type TokenAccessReadOnlyRefsField

type TokenAccessReadOnlyRefsField struct {
	TokenAccessReadOnlyRefs Refs `bson:"tokenAccessReadOnly_refs"`
}

type Tokens

type Tokens struct {
	ReadOnly           AccessToken `bson:"readOnly"`
	ReadAndWrite       AccessToken `bson:"readAndWrite"`
	ReadAndWritePrefix string      `bson:"readAndWritePrefix"`
}

type TokensField

type TokensField struct {
	Tokens Tokens `bson:"tokens"`
}

type TrashedByField

type TrashedByField struct {
	TrashedBy Refs `bson:"trashed"`
}

type TreeElement

type TreeElement interface {
	GetId() primitive.ObjectID
}

type TreeField

type TreeField struct {
	RootFolder []*Folder `bson:"rootFolder"`
}

func (*TreeField) GetRootFolder

func (p *TreeField) GetRootFolder() (*Folder, error)

type TreeWalker

type TreeWalker func(element TreeElement, path sharedTypes.PathName) error

type VersionField

type VersionField struct {
	Version sharedTypes.Version `bson:"version"`
}

Jump to

Keyboard shortcuts

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