Documentation ¶
Index ¶
- Variables
- func NewOSUserConfiger() osUserConfiger
- func NewProjects(configer Configer) *mcprojects
- type ClientAPI
- func (c *ClientAPI) CreateDirectory(projectName, path string) error
- func (c *ClientAPI) CreateProject(name, path string) error
- func (c *ClientAPI) CreateProjectDirectories(projectName string) error
- func (c *ClientAPI) DownloadDirectory(projectName string, path string, recursive bool, numThreads int) error
- func (c *ClientAPI) DownloadFile(projectName string, path string) error
- func (c *ClientAPI) DownloadProject(projectName string, numThreads int) error
- func (c *ClientAPI) IndexProject(projectName string) error
- func (c *ClientAPI) ProjectStatus(projectID string) error
- func (c *ClientAPI) RenameProject(oldName, newName string) error
- func (c *ClientAPI) UploadDirectory(projectName string, path string, recursive bool, numThreads int) error
- func (c *ClientAPI) UploadFile(projectName string, path string) error
- func (c *ClientAPI) UploadProject(projectName string, numThreads int) error
- type Configer
- type Directory
- type File
- type Project
- type ProjectDB
- type ProjectDBLister
- type ProjectDBOpener
- type ProjectDBSpec
- type ProjectOpenFlags
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidProjectFilePath = errors.New("path not in project") ErrFileNotUploaded = errors.New("existing file not uploaded") ErrFileVersionNotUploaded = errors.New("existing file has changes that haven't been uploaded") )
var ProjectOpener sqlProjectDBOpener = sqlProjectDBOpener{ // contains filtered or unexported fields }
var Projects *mcprojects = NewProjects(NewOSUserConfiger())
Functions ¶
func NewOSUserConfiger ¶
func NewOSUserConfiger() osUserConfiger
func NewProjects ¶
func NewProjects(configer Configer) *mcprojects
Types ¶
type ClientAPI ¶
type ClientAPI struct {
// contains filtered or unexported fields
}
ClientAPI implements API calls to the mcstored server.
func NewClientAPI ¶
func NewClientAPI() *ClientAPI
NewClientAPI creates a new instance of a ClientAPI. It checks for client side project data in $HOME/.materialscommons
func (*ClientAPI) CreateDirectory ¶
CreateDirectory will create a single directory on the server for the named project.
func (*ClientAPI) CreateProject ¶
CreateProject creates a new project. If the project already exists on the client it returns app.ErrExists.
func (*ClientAPI) CreateProjectDirectories ¶
CreateProjectDirectories will create all the directories on the server that are found under the client project.
func (*ClientAPI) DownloadDirectory ¶
func (*ClientAPI) DownloadFile ¶
func (*ClientAPI) DownloadProject ¶
func (*ClientAPI) IndexProject ¶
IndexProject will index a project (whatever that means at the moment)
func (*ClientAPI) ProjectStatus ¶
func (*ClientAPI) RenameProject ¶
RenameProject will rename an existing project.
func (*ClientAPI) UploadDirectory ¶
func (c *ClientAPI) UploadDirectory(projectName string, path string, recursive bool, numThreads int) error
UploadDirectory uploads all the entries in a given directory. It will not follow sub directories. However it will create sub directories that are direct children of the given path.
func (*ClientAPI) UploadFile ¶
UploadFile uploads a single file to the given project.
type ProjectDB ¶
type ProjectDB interface { Project() *Project UpdateProject(project *Project) error InsertDirectory(dir *Directory) (*Directory, error) UpdateDirectory(dir *Directory) error Directories() []Directory Ls(dir Directory) []File InsertFile(f *File) (*File, error) FindFile(fileName string, dirID int64) (*File, error) UpdateFile(f *File) error FindDirectory(path string) (*Directory, error) Clone() ProjectDB }
type ProjectDBLister ¶
type ProjectDBLister interface { // All returns a list of the known ProjectDBs. The ProjectDBs // are open. All() ([]ProjectDB, error) // Create will create a new local project and populate // the default database entries. The returned ProjectDB // has already been opened. Create(dbSpec ProjectDBSpec) (ProjectDB, error) }
type ProjectDBOpener ¶
type ProjectDBSpec ¶
type ProjectOpenFlags ¶
type ProjectOpenFlags int