mo_file

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapByNameLower

func MapByNameLower(entries []Entry) map[string]Entry

Types

type ConcreteEntry

type ConcreteEntry struct {
	Raw                  json.RawMessage
	Id                   string `path:"id" json:"id"`
	Tag                  string `path:"\\.tag" json:"tag"`
	Name                 string `path:"name" json:"name"`
	PathLower            string `path:"path_lower" json:"path_lower"`
	PathDisplay          string `path:"path_display" json:"path_display"`
	ClientModified       string `path:"client_modified" json:"client_modified"`
	ServerModified       string `path:"server_modified" json:"server_modified"`
	Revision             string `path:"rev" json:"revision"`
	Size                 int64  `path:"size" json:"size"`
	ContentHash          string `path:"content_hash" json:"content_hash"`
	SharedFolderId       string `path:"sharing_info.shared_folder_id" json:"shared_folder_id"`
	ParentSharedFolderId string `path:"sharing_info.parent_shared_folder_id" json:"parent_shared_folder_id"`
}

func (ConcreteEntry) IsDeleted

func (z ConcreteEntry) IsDeleted() bool

func (ConcreteEntry) IsFile

func (z ConcreteEntry) IsFile() bool

func (ConcreteEntry) IsFolder

func (z ConcreteEntry) IsFolder() bool

type Deleted

type Deleted struct {
	Raw              json.RawMessage
	EntryTag         string `path:"\\.tag" json:"tag"`
	EntryName        string `path:"name" json:"name"`
	EntryPathLower   string `path:"path_lower" json:"path_lower"`
	EntryPathDisplay string `path:"path_display" json:"path_display"`
}

func (*Deleted) Concrete

func (z *Deleted) Concrete() *ConcreteEntry

func (*Deleted) Deleted

func (z *Deleted) Deleted() (*Deleted, bool)

func (*Deleted) File

func (z *Deleted) File() (*File, bool)

func (*Deleted) Folder

func (z *Deleted) Folder() (*Folder, bool)

func (*Deleted) LockInfo

func (z *Deleted) LockInfo() *LockInfo

func (*Deleted) Metadata

func (z *Deleted) Metadata() *Metadata

func (*Deleted) Name

func (z *Deleted) Name() string

func (*Deleted) Path

func (z *Deleted) Path() mo_path.DropboxPath

func (*Deleted) PathDisplay

func (z *Deleted) PathDisplay() string

func (*Deleted) PathLower

func (z *Deleted) PathLower() string

func (*Deleted) Tag

func (z *Deleted) Tag() string

type Entry

type Entry interface {
	// Tag for the entry. `file`, `folder`, or `deleted`.
	Tag() string

	// File or folder basename
	Name() string

	// Display path
	PathDisplay() string

	// Lowercase path
	PathLower() string

	// Path
	Path() mo_path.DropboxPath

	// Returns File, returns nil & false if an entry is not a File.
	File() (*File, bool)

	// Returns Folder, return nil & false if an entry is not a Folder.
	Folder() (*Folder, bool)

	// Returns Deleted, return nil & false if an entry is not a Deleted.
	Deleted() (*Deleted, bool)

	// Returns metadata instance.
	Metadata() *Metadata

	// Returns concrete entry
	Concrete() *ConcreteEntry

	// Returns lock info, returns nil if the entry does not have lock info (e.g. a deleted entry or a folder)
	LockInfo() *LockInfo
}

type Export

type Export struct {
	Raw              json.RawMessage
	EntryName        string `path:"file_metadata.name" json:"name"`
	EntryPathLower   string `path:"file_metadata.path_lower" json:"path_lower"`
	EntryPathDisplay string `path:"file_metadata.path_display" json:"path_display"`
	Id               string `path:"file_metadata.id" json:"id"`
	ClientModified   string `path:"file_metadata.client_modified" json:"client_modified"`
	ServerModified   string `path:"file_metadata.server_modified" json:"server_modified"`
	Revision         string `path:"file_metadata.rev" json:"revision"`
	Size             int64  `path:"file_metadata.size" json:"size"`
	ContentHash      string `path:"file_metadata.content_hash" json:"content_hash"`
	ExportName       string `path:"export_metadata.name" json:"export_name"`
	ExportSize       int64  `path:"export_metadata.size" json:"export_size"`
	ExportHash       string `path:"export_metadata.export_hash" json:"export_hash"`
}

type File

type File struct {
	Raw              json.RawMessage
	EntryTag         string `path:"\\.tag" json:"tag"`
	EntryName        string `path:"name" json:"name"`
	EntryPathLower   string `path:"path_lower" json:"path_lower"`
	EntryPathDisplay string `path:"path_display" json:"path_display"`
	Id               string `path:"id" json:"id"`
	ClientModified   string `path:"client_modified" json:"client_modified"`
	ServerModified   string `path:"server_modified" json:"server_modified"`
	Revision         string `path:"rev" json:"revision"`
	Size             int64  `path:"size" json:"size"`
	ContentHash      string `path:"content_hash" json:"content_hash"`
}

func (*File) Concrete

func (z *File) Concrete() *ConcreteEntry

func (*File) Deleted

func (z *File) Deleted() (*Deleted, bool)

func (*File) File

func (z *File) File() (*File, bool)

func (*File) Folder

func (z *File) Folder() (*Folder, bool)

func (*File) LockInfo

func (z *File) LockInfo() *LockInfo

func (*File) Metadata

func (z *File) Metadata() *Metadata

func (*File) Name

func (z *File) Name() string

func (*File) Path

func (z *File) Path() mo_path.DropboxPath

func (*File) PathDisplay

func (z *File) PathDisplay() string

func (*File) PathLower

func (z *File) PathLower() string

func (*File) Tag

func (z *File) Tag() string

type Folder

type Folder struct {
	Raw                       json.RawMessage
	Id                        string `path:"id" json:"id"`
	EntryTag                  string `path:"\\.tag" json:"tag"`
	EntryName                 string `path:"name" json:"name"`
	EntryPathLower            string `path:"path_lower" json:"path_lower"`
	EntryPathDisplay          string `path:"path_display" json:"path_display"`
	EntrySharedFolderId       string `path:"sharing_info.shared_folder_id" json:"shared_folder_id"`
	EntryParentSharedFolderId string `path:"sharing_info.parent_shared_folder_id" json:"parent_shared_folder_id"`
}

func (*Folder) Concrete

func (z *Folder) Concrete() *ConcreteEntry

func (*Folder) Deleted

func (z *Folder) Deleted() (*Deleted, bool)

func (*Folder) File

func (z *Folder) File() (*File, bool)

func (*Folder) Folder

func (z *Folder) Folder() (*Folder, bool)

func (*Folder) LockInfo

func (z *Folder) LockInfo() *LockInfo

func (*Folder) Metadata

func (z *Folder) Metadata() *Metadata

func (*Folder) Name

func (z *Folder) Name() string

func (*Folder) ParentSharedFolderId

func (z *Folder) ParentSharedFolderId() string

func (*Folder) Path

func (z *Folder) Path() mo_path.DropboxPath

func (*Folder) PathDisplay

func (z *Folder) PathDisplay() string

func (*Folder) PathLower

func (z *Folder) PathLower() string

func (*Folder) SharedFolderId

func (z *Folder) SharedFolderId() string

func (*Folder) Tag

func (z *Folder) Tag() string

type LockInfo

type LockInfo struct {
	Raw                  json.RawMessage
	Id                   string `path:"id" json:"id"`
	Tag                  string `path:"\\.tag" json:"tag"`
	Name                 string `path:"name" json:"name"`
	PathLower            string `path:"path_lower" json:"path_lower"`
	PathDisplay          string `path:"path_display" json:"path_display"`
	ClientModified       string `path:"client_modified" json:"client_modified"`
	ServerModified       string `path:"server_modified" json:"server_modified"`
	Revision             string `path:"rev" json:"revision"`
	Size                 int64  `path:"size" json:"size"`
	ContentHash          string `path:"content_hash" json:"content_hash"`
	SharedFolderId       string `path:"sharing_info.shared_folder_id" json:"shared_folder_id"`
	ParentSharedFolderId string `path:"sharing_info.parent_shared_folder_id" json:"parent_shared_folder_id"`
	IsLockHolder         bool   `path:"file_lock_info.is_lockholder" json:"is_lock_holder"`
	LockHolderName       string `path:"file_lock_info.lockholder_name" json:"lock_holder_name"`
	LockHolderAccountId  string `path:"file_lock_info.lockholder_account_id" json:"lock_holder_account_id"`
	LockCreated          string `path:"file_lock_info.created" json:"lock_created"`
}

type Match

type Match struct {
	Raw              json.RawMessage
	EntryTag         string `path:"metadata.metadata.\\.tag" json:"tag"`
	EntryName        string `path:"metadata.metadata.name" json:"name"`
	EntryPathDisplay string `path:"metadata.metadata.path_display" json:"path_display"`
	EntryPathLower   string `path:"metadata.metadata.path_lower" json:"path_lower"`
}

func (*Match) Concrete

func (z *Match) Concrete() *ConcreteEntry

func (*Match) HighlightHtml

func (z *Match) HighlightHtml() string

func (*Match) Highlighted

func (z *Match) Highlighted() (mh *MatchHighlighted)

type MatchHighlighted

type MatchHighlighted struct {
	Raw              json.RawMessage
	EntryTag         string `json:"tag"`
	EntryName        string `json:"name"`
	EntryPathDisplay string `json:"path_display"`
	EntryPathLower   string `json:"path_lower"`
	HighlightHtml    string `json:"highlight_html"`
}

type Metadata

type Metadata struct {
	Raw              json.RawMessage
	EntryTag         string `path:"\\.tag" json:"tag"`
	EntryName        string `path:"name" json:"name"`
	EntryPathDisplay string `path:"path_display" json:"path_display"`
	EntryPathLower   string `path:"path_lower" json:"path_lower"`
}

func (*Metadata) Concrete

func (z *Metadata) Concrete() *ConcreteEntry

func (*Metadata) Deleted

func (z *Metadata) Deleted() (*Deleted, bool)

func (*Metadata) File

func (z *Metadata) File() (*File, bool)

func (*Metadata) Folder

func (z *Metadata) Folder() (*Folder, bool)

func (*Metadata) LockInfo

func (z *Metadata) LockInfo() *LockInfo

func (*Metadata) Metadata

func (z *Metadata) Metadata() *Metadata

func (*Metadata) Name

func (z *Metadata) Name() string

func (*Metadata) Path

func (z *Metadata) Path() mo_path.DropboxPath

func (*Metadata) PathDisplay

func (z *Metadata) PathDisplay() string

func (*Metadata) PathLower

func (z *Metadata) PathLower() string

func (*Metadata) Tag

func (z *Metadata) Tag() string

Jump to

Keyboard shortcuts

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