Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Files API #353

Merged
merged 49 commits into from
Nov 21, 2018
Merged

Files API #353

merged 49 commits into from
Nov 21, 2018

Conversation

sanderpick
Copy link
Member

Still WIP but I want to start triggering CI. Mobile is coming together fast.

Includes required thread types, namely the account thread.
Mills are inspired by Transloadit robots, handling different files types described by the DAG node
schemas.
This was causing the file to always get re-added since the checksum was different each time.
Still need to handle the write rejection, but wanted to get this in pre-migration.
One step can now use another via the "use" keyword.
Source is file/parent checksum + hash of mill opts. This allows for an additional pre-mill check for
the file.
@sanderpick
Copy link
Member Author

@carsonfarmer heads up, I created another field on file called opts (hash of opts), which used to be appended to source like source:opts... was a little weird... will be nice to be able to use source for actual queries with opts moved off to it's own. We can still check if a file has already been milled pre-mill by looking for existing files with mill, source, and opts all matching. There's a unique index compound index on those fields.

@sanderpick
Copy link
Member Author

sanderpick commented Nov 20, 2018

Added new gateway handling to resolve the new style avatars. The schema adds a small and large, which are accessible via /avatar/small, /avatar/large. Plain old /avatar falls back to /avatar/small.

@sanderpick
Copy link
Member Author

sanderpick commented Nov 20, 2018

new profile commands are:

  • $ textile profile get
  • $ textile profile set username <username>
  • $ textile profile set avatar <any image file hash, best results with a large or raw file from photos>

}

// PrepareFilesAsync is the async flavor of PrepareFiles
func (m *Mobile) PrepareFilesAsync(path string, threadId string, cb Callback) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asutula I added an async version of PrepareFiles here which takes a callback interface. Let me know when you're around and we can talk through this and other changes.

@sanderpick
Copy link
Member Author

ok guys, would like to get this merged. reviews requested!

Copy link
Member

@carsonfarmer carsonfarmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoah. this is huge. i've gone through everything with a medium-tooth comb. left mobile mostly for @asutula though. i've been playing with earlier versions of this, so seems stable enough to merge and start really kicking the tires...

cmd/files.go Show resolved Hide resolved
cmd/files.go Show resolved Hide resolved
cmd/invite.go Show resolved Hide resolved
core/api.go Show resolved Hide resolved
core/api.go Outdated Show resolved Hide resolved
core/api_invites.go Show resolved Hide resolved
core/main.go Show resolved Hide resolved
core/thread.go Show resolved Hide resolved
core/thread_invites.go Show resolved Hide resolved
gateway/main.go Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants