mo_path

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: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DropboxPath

type DropboxPath interface {
	// Path format for Dropbox API
	Path() string

	// Namespace ID & true, if exists. Otherwise "" and false.
	Namespace() (namespace string, exist bool)

	// File/Folder ID & true, if exists. Otherwise "" and false.
	Id() (id string, exist bool)

	// Logical part of the path. That doesn't contain namespace or file/folder id.
	// Returns `/` if the path point to root.
	LogicalPath() string

	// Parent path. Returns same instance if it's a root path.
	// NamespaceId may not be accurate.
	ParentPath() DropboxPath

	// Child path
	ChildPath(elem ...string) DropboxPath

	// Parent path
	// Notice: parent namespace_id might be differ from actual. This path returns
	// a same namespace_id of this instance.
	Parent() DropboxPath

	IsValid() bool

	// Is root path
	IsRoot() bool
}

func NewDropboxPath

func NewDropboxPath(path string) DropboxPath

Create new `Path` instance. Windows style paths are automatically replaced for API.

func NewPathDisplay

func NewPathDisplay(path string) DropboxPath

Create new `Path` instance. No validation & modification

Jump to

Keyboard shortcuts

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