Documentation ¶
Index ¶
- Constants
- Variables
- func Coalesce(err error, aerr *Error) error
- func Format(x interface{}) string
- func ParseApiKey(apiKey string) (string, int, string, error)
- func PrintFormat(x interface{})
- func Println(a ...interface{})
- type Acquisition
- type AcquisitionSearchResponse
- type Analysis
- type AnalysisFile
- type AnalysisInput
- type AnalysisListItem
- type AnalysisSearchResponse
- type ApiKeyClientOption
- type ApiKeyClientOptions
- type AuthStatus
- type Batch
- type BatchProposal
- type Classification
- type Client
- func (c *Client) AddAcquisition(acquisition *Acquisition) (string, *http.Response, error)
- func (c *Client) AddAcquisitionAnalysis(acquisitionId string, analysis *AnalysisInput) (string, *http.Response, error)
- func (c *Client) AddAcquisitionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) AddAcquisitionNote(id, text string) (*http.Response, error)
- func (c *Client) AddAcquisitionTag(id, tag string) (*http.Response, error)
- func (c *Client) AddAcquisitionsToCollection(id string, aqids []string) (*http.Response, error)
- func (c *Client) AddAnalysisNote(analysisId string, text string) (*http.Response, error)
- func (c *Client) AddAnalysisTag(id, tag string) (*http.Response, error)
- func (c *Client) AddCollection(collection *Collection) (string, *http.Response, error)
- func (c *Client) AddCollectionAnalysis(collectionId string, analysis *AnalysisInput) (string, *http.Response, error)
- func (c *Client) AddCollectionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) AddCollectionNote(id, text string) (*http.Response, error)
- func (c *Client) AddGear(gear *GearDoc) (string, *http.Response, error)
- func (c *Client) AddGroup(group *Group) (string, *http.Response, error)
- func (c *Client) AddGroupTag(id, tag string) (*http.Response, error)
- func (c *Client) AddJob(job *Job) (string, *http.Response, error)
- func (c *Client) AddJobLogs(id string, statements []*JobLogStatement) (*http.Response, error)
- func (c *Client) AddModality(modality *Modality) (*http.Response, error)
- func (c *Client) AddProject(project *Project) (string, *http.Response, error)
- func (c *Client) AddProjectAnalysis(projectId string, analysis *AnalysisInput) (string, *http.Response, error)
- func (c *Client) AddProjectFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) AddProjectNote(id, text string) (*http.Response, error)
- func (c *Client) AddProjectTag(id, tag string) (*http.Response, error)
- func (c *Client) AddSession(session *Session) (string, *http.Response, error)
- func (c *Client) AddSessionAnalysis(sessionId string, analysis *AnalysisInput) (string, *http.Response, error)
- func (c *Client) AddSessionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) AddSessionNote(id, text string) (*http.Response, error)
- func (c *Client) AddSessionTag(id, tag string) (*http.Response, error)
- func (c *Client) AddSessionsToCollection(id string, sessionids []string) (*http.Response, error)
- func (c *Client) AddUser(user *User) (string, *http.Response, error)
- func (c *Client) CancelBatch(id string) (int, *http.Response, error)
- func (c *Client) ChangeJobState(id string, state JobState) (*http.Response, error)
- func (c *Client) CompleteJob(id, ticket string, completion *JobCompletion) (*http.Response, error)
- func (c *Client) CompleteUploadTicket(url string, ticketId string) ([]*File, *http.Response, error)
- func (c *Client) CreateUploadTicket(url string, metadata []byte, files ...*UploadSource) (*TicketResponse, *http.Response, error)
- func (c *Client) DeleteAcquisition(id string) (*http.Response, error)
- func (c *Client) DeleteAcquisitionFile(id string, filename string) (*http.Response, error)
- func (c *Client) DeleteAcquisitionFileInfoFields(id string, filename string, keys []string) (*http.Response, error)
- func (c *Client) DeleteAcquisitionInfoFields(id string, keys []string) (*http.Response, error)
- func (c *Client) DeleteAnalysisInfoFields(id string, keys []string) (*http.Response, error)
- func (c *Client) DeleteCollection(id string) (*http.Response, error)
- func (c *Client) DeleteCollectionFile(id string, filename string) (*http.Response, error)
- func (c *Client) DeleteCollectionFileInfoFields(id string, filename string, keys []string) (*http.Response, error)
- func (c *Client) DeleteCollectionInfoFields(id string, keys []string) (*http.Response, error)
- func (c *Client) DeleteGear(id string) (*http.Response, error)
- func (c *Client) DeleteGroup(id string) (*http.Response, error)
- func (c *Client) DeleteModality(id string) (*http.Response, error)
- func (c *Client) DeleteProject(id string) (*http.Response, error)
- func (c *Client) DeleteProjectFile(id string, filename string) (*http.Response, error)
- func (c *Client) DeleteProjectFileInfoFields(id string, filename string, keys []string) (*http.Response, error)
- func (c *Client) DeleteProjectInfoFields(id string, keys []string) (*http.Response, error)
- func (c *Client) DeleteSession(id string) (*http.Response, error)
- func (c *Client) DeleteSessionFile(id string, filename string) (*http.Response, error)
- func (c *Client) DeleteSessionFileInfoFields(id string, filename string, keys []string) (*http.Response, error)
- func (c *Client) DeleteSessionInfoFields(id string, keys []string) (*http.Response, error)
- func (c *Client) DeleteUser(id string) (*http.Response, error)
- func (c *Client) Download(url string, progress chan<- int64, destination *DownloadSource) chan error
- func (c *Client) DownloadFileFromAcquisition(id, name string, path string) error
- func (c *Client) DownloadFileFromAnalysis(analysisId, filename, path string) error
- func (c *Client) DownloadFileFromCollection(id, name string, path string) error
- func (c *Client) DownloadFileFromProject(id, name string, path string) error
- func (c *Client) DownloadFileFromSession(id, name string, path string) error
- func (c *Client) DownloadFromAcquisition(id string, filename string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) DownloadFromAnalysis(analysisId, filename string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) DownloadFromCollection(id string, filename string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) DownloadFromProject(id string, filename string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) DownloadFromSession(id string, filename string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) DownloadInputFileFromAnalysis(analysisId, filename, path string) error
- func (c *Client) DownloadInputFromAnalysis(analysisId, filename string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) DownloadSimple(url string, destination *DownloadSource) (chan int64, chan error)
- func (c *Client) GetAcquisition(id string) (*Acquisition, *http.Response, error)
- func (c *Client) GetAcquisitionDownloadUrl(id string, filename string) (string, *http.Response, error)
- func (c *Client) GetAllAcquisitions() ([]*Acquisition, *http.Response, error)
- func (c *Client) GetAllBatches() ([]*Batch, *http.Response, error)
- func (c *Client) GetAllCollections() ([]*Collection, *http.Response, error)
- func (c *Client) GetAllGears() ([]*GearDoc, *http.Response, error)
- func (c *Client) GetAllGroups() ([]*Group, *http.Response, error)
- func (c *Client) GetAllModalities() ([]*Modality, *http.Response, error)
- func (c *Client) GetAllProjects() ([]*Project, *http.Response, error)
- func (c *Client) GetAllSessions() ([]*Session, *http.Response, error)
- func (c *Client) GetAllUsers() ([]*User, *http.Response, error)
- func (c *Client) GetAnalyses(cont_name string, cid string, sub_cont string) ([]*AnalysisListItem, *http.Response, error)
- func (c *Client) GetAnalysis(id string) (*Analysis, *http.Response, error)
- func (c *Client) GetAnalysisDownloadUrl(id string, filename string) (string, *http.Response, error)
- func (c *Client) GetAnalysisInputDownloadUrl(id string, filename string) (string, *http.Response, error)
- func (c *Client) GetAuthStatus() (*AuthStatus, *http.Response, error)
- func (c *Client) GetBatch(id string) (*Batch, *http.Response, error)
- func (c *Client) GetCollection(id string) (*Collection, *http.Response, error)
- func (c *Client) GetCollectionAcquisitions(id string) ([]*Session, *http.Response, error)
- func (c *Client) GetCollectionDownloadUrl(id string, filename string) (string, *http.Response, error)
- func (c *Client) GetCollectionSessionAcquisitions(id string, sid string) ([]*Session, *http.Response, error)
- func (c *Client) GetCollectionSessions(id string) ([]*Session, *http.Response, error)
- func (c *Client) GetConfig() (*Config, *http.Response, error)
- func (c *Client) GetCurrentUser() (*User, *http.Response, error)
- func (c *Client) GetGear(id string) (*GearDoc, *http.Response, error)
- func (c *Client) GetGearInvocation(id string) (map[string]interface{}, *http.Response, error)
- func (c *Client) GetGroup(id string) (*Group, *http.Response, error)
- func (c *Client) GetJob(id string) (*Job, *http.Response, error)
- func (c *Client) GetJobLogs(id string) (*JobLog, *http.Response, error)
- func (c *Client) GetJobStats(whitelist, blacklist *JobsMatch, capabilities []string, maxJobs int) (*JobStateCount, *http.Response, error)
- func (c *Client) GetModality(id string) (*Modality, *http.Response, error)
- func (c *Client) GetProject(id string) (*Project, *http.Response, error)
- func (c *Client) GetProjectDownloadUrl(id string, filename string) (string, *http.Response, error)
- func (c *Client) GetProjectSessions(id string) ([]*Session, *http.Response, error)
- func (c *Client) GetSession(id string) (*Session, *http.Response, error)
- func (c *Client) GetSessionAcquisitions(id string) ([]*Acquisition, *http.Response, error)
- func (c *Client) GetSessionDownloadUrl(id string, filename string) (string, *http.Response, error)
- func (c *Client) GetTicketDownloadUrl(container string, id string, filename string) (string, *http.Response, error)
- func (c *Client) GetTicketDownloadUrlFromUrl(url string) (string, *http.Response, error)
- func (c *Client) GetUser(id string) (*User, *http.Response, error)
- func (c *Client) GetVersion() (*Version, *http.Response, error)
- func (c *Client) HeartbeatJob(id string) (*http.Response, error)
- func (c *Client) JobsAsk(question *JobsQuestion) (*JobsAnswer, *http.Response, error)
- func (c *Client) ModifyAcquisition(id string, acquisition *Acquisition) (*http.Response, error)
- func (c *Client) ModifyAcquisitionFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
- func (c *Client) ModifyCollection(id string, collection *Collection) (*http.Response, error)
- func (c *Client) ModifyCollectionFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
- func (c *Client) ModifyGroup(id string, group *Group) (*http.Response, error)
- func (c *Client) ModifyJob(id string, job *Job) (*http.Response, error)
- func (c *Client) ModifyProject(id string, project *Project) (*http.Response, error)
- func (c *Client) ModifyProjectFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
- func (c *Client) ModifySession(id string, session *Session) (*http.Response, error)
- func (c *Client) ModifySessionFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
- func (c *Client) ModifyUser(id string, user *User) (*http.Response, error)
- func (c *Client) PrepareCompleteJob(id string) (string, *http.Response, error)
- func (c *Client) ProposeBatch(gearId string, config map[string]interface{}, tags []string, ...) (*BatchProposal, *http.Response, error)
- func (c *Client) RemoveAcquisitionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) RemoveCollectionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) RemoveProjectFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) RemoveSessionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) ReplaceAcquisitionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) ReplaceAcquisitionFileInfo(id string, filename string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceAcquisitionInfo(id string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceAnalysisInfo(id string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceCollectionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) ReplaceCollectionFileInfo(id string, filename string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceCollectionInfo(id string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceModality(modality *Modality) (*http.Response, error)
- func (c *Client) ReplaceProjectFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) ReplaceProjectFileInfo(id string, filename string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceProjectInfo(id string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceSessionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
- func (c *Client) ReplaceSessionFileInfo(id string, filename string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) ReplaceSessionInfo(id string, replace map[string]interface{}) (*http.Response, error)
- func (c *Client) Search(search_query *SearchQuery) ([]*SearchResponse, *http.Response, error)
- func (c *Client) SearchRaw(search_query *SearchQuery) (*RawSearchResponseList, *http.Response, error)
- func (c *Client) SetAcquisitionFileInfo(id string, filename string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetAcquisitionInfo(id string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetAnalysisInfo(id string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetCollectionFileInfo(id string, filename string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetCollectionInfo(id string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetProjectFileInfo(id string, filename string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetProjectInfo(id string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetSessionFileInfo(id string, filename string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SetSessionInfo(id string, set map[string]interface{}) (*http.Response, error)
- func (c *Client) SignedUrlUpload(ticket TicketResponse, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) StartBatch(id string) ([]*Job, *http.Response, error)
- func (c *Client) StartJobs(whitelist, blacklist *JobsMatch, capabilities []string, peek bool, maxJobs int) (JobRetrieval, []*Job, *http.Response, error)
- func (c *Client) StartNextPendingJobLegacy(peek bool, tags ...string) (JobRetrieval, *Job, *http.Response, error)
- func (c *Client) Upload(url string, metadata []byte, progress chan<- int64, files []*UploadSource) chan error
- func (c *Client) UploadFileToAcquisition(id string, path string) error
- func (c *Client) UploadFileToAnalysis(id string, path string) error
- func (c *Client) UploadFileToCollection(id string, path string) error
- func (c *Client) UploadFileToProject(id string, path string) error
- func (c *Client) UploadFileToSession(id string, path string) error
- func (c *Client) UploadFilesToAnalysis(id string, paths []string) error
- func (c *Client) UploadSimple(url string, metadata []byte, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadSimpleSignedUrl(url string, metadata []byte, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadSimpleWithRate(url string, metadata []byte, rate float64, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadToAcquisition(id string, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadToAnalysis(id string, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadToCollection(id string, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadToProject(id string, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadToSession(id string, files ...*UploadSource) (chan int64, chan error)
- func (c *Client) UploadWithRate(url string, metadata []byte, progress chan<- int64, rate float64, ...) chan error
- func (c *Client) UploadWithRetry(request *http.Request, retryDelay time.Duration) (*http.Response, error)
- type Collection
- type CollectionSearchResponse
- type Config
- type ContainerReference
- type DebugTransport
- type DeletedResponse
- type DownloadSource
- type DownloadTicket
- type Error
- type File
- type FileFields
- type FileReference
- type FileSearchResponse
- type Formula
- type FormulaResult
- type Gear
- type GearCategory
- type GearDoc
- type GearSource
- type Group
- type GroupSearchResponse
- type IdResponse
- type Input
- type Job
- type JobCompletion
- type JobCompletionTicket
- type JobCompletionTicketResponse
- type JobExecutorProfile
- type JobLog
- type JobLogStatement
- type JobProfile
- type JobRetrieval
- type JobState
- type JobStateCount
- type JobsAnswer
- type JobsAskType
- type JobsMatch
- type JobsQuestion
- type Key
- type Modality
- type ModifiedAndJobsResponse
- type ModifiedAndJobsSpawned
- type ModifiedResponse
- type Note
- type ObsoleteJobProfile
- type Origin
- type Output
- type ParentSearchResponse
- type Permission
- type ProgressReader
- type Project
- type ProjectSearchResponse
- type RawSearchResponse
- type RawSearchResponseList
- type Result
- type RootModeQueryStruct
- type SearchQuery
- type SearchResponse
- type SearchType
- type Session
- type SessionSearchResponse
- type Subject
- type SubjectSearchResponse
- type Target
- type TicketResponse
- type UploadBody
- type UploadResponse
- type UploadSource
- type User
- type Version
Constants ¶
const DefaultMountPoint = "/proc"
const RetryDelay = time.Duration(5 * time.Second) // 5 seconds
Duration in nanoseconds to sleep between signed url upload attempts
const SdkDebugKey = "SdkDebug"
SdkDebugKey is the environment variable used to control request debug logging. If enabled, the SDK will log an HTTP/1.1 representation of all requests made to stdout.
const SignedUrlUploadMaxAttempts = 3
Max number of attempts when signed url upload fails
const UploadBucketSize = 16777216 // 16 MB
Use a 16 MB bucket size for rate-limiting
Variables ¶
var DefaultApiKeyClientOptions = ApiKeyClientOptions{ InsecureSkipVerify: false, InsecureUsePlaintext: false, EnableRoot: false, }
Functions ¶
func ParseApiKey ¶
ParseApiKey accepts an API key and returns the hostname, port, key, and any parsing error.
func PrintFormat ¶
func PrintFormat(x interface{})
Types ¶
type Acquisition ¶
type Acquisition struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty" bson:"label"` SessionId string `json:"session,omitempty"` Timestamp *time.Time `json:"timestamp,omitempty"` Timezone string `json:"timezone,omitempty"` Uid string `json:"uid,omitempty"` Notes []*Note `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` Info map[string]interface{} `json:"info,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Files []*File `json:"files,omitempty"` Public bool `json:"public,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` Deleted *time.Time `json:"deleted,omitempty"` }
type Analysis ¶
type Analysis struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty"` Parent *ContainerReference `json:"parent,omitempty"` Description string `json:"description,omitempty"` // Treat this as a origin of { 'type': 'user', 'id': 'this-field' } User string `json:"user,omitempty"` Notes []*Note `json:"notes,omitempty"` // For now, jobs are always inflated by the endpoints we fetch them through. // https://github.com/scitran/core/issues/908#issuecomment-324766048 item 2 Job *Job `json:"job,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Inputs []*AnalysisFile `json:"inputs,omitempty"` Files []*AnalysisFile `json:"files,omitempty"` Public bool `json:"public,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` Tags []string `json:"tags,omitempty"` Info map[string]interface{} `json:"info,omitempty"` }
type AnalysisFile ¶
type AnalysisFile struct { Name string `json:"name,omitempty"` Origin *Origin `json:"origin,omitempty"` Size int `json:"size,omitempty"` Modality string `json:"modality,omitempty"` Mimetype string `json:"mimetype,omitempty"` Measurements []string `json:"measurements,omitempty"` Type string `json:"type,omitempty"` Tags []string `json:"tags,omitempty"` Info map[string]interface{} `json:"info,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` }
Two extra fields beyond File https://github.com/scitran/core/issues/908#issuecomment-324766048 item 1
type AnalysisInput ¶
type AnalysisInput struct { Name string `json:"label,omitempty"` Description string `json:"description,omitempty"` Notes []*Note `json:"notes,omitempty"` Inputs []*FileReference `json:"inputs,omitempty"` Job *Job `json:"job,omitempty"` }
type AnalysisListItem ¶
type AnalysisListItem struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty"` Parent *ContainerReference `json:"parent,omitempty"` Description string `json:"description,omitempty"` // Treat this as a origin of { 'type': 'user', 'id': 'this-field' } User string `json:"user,omitempty"` Notes []*Note `json:"notes,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Inputs []*AnalysisFile `json:"inputs,omitempty"` Files []*AnalysisFile `json:"files,omitempty"` Public bool `json:"public,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` JobId string `json:"job,omitempty"` }
type AnalysisSearchResponse ¶
type ApiKeyClientOption ¶
type ApiKeyClientOption func(*ApiKeyClientOptions)
var EnableRoot ApiKeyClientOption
Specify that the ApiKeyClient should operate in Root (Manage Site) mode.
var InsecureNoSSLVerification ApiKeyClientOption
Specify that the ApiKeyClient should not verify SSL connections. Should only be used for development.
var InsecureUsePlaintext ApiKeyClientOption
Specify that the ApiKeyClient should use a plaintext HTTP transport. Should only be used for development.
func DebugLogRequests ¶
func DebugLogRequests(w io.Writer) ApiKeyClientOption
Specify that the ApiKeyClient should log all request bodies to the specified Writer. See DebugTransport for details.
func UserAgent ¶
func UserAgent(product string) ApiKeyClientOption
Specify the product portion of the user agent string.
type ApiKeyClientOptions ¶
type ApiKeyClientOptions struct { // Skip SSL verification InsecureSkipVerify bool // Use plaintext (HTTP) transport InsecureUsePlaintext bool // Enable root (Manage Site) mode EnableRoot bool // User agent product string (optional) Product string // A writer to send debug request bodies to, if any DebugWriter io.Writer }
type AuthStatus ¶
type Batch ¶
type Batch struct { Id string `json:"_id,omitempty" bson:"_id"` GearId string `json:"gear_id,omitempty"` State JobState `json:"state,omitempty"` Origin *Origin `json:"origin,omitempty"` Config map[string]interface{} `json:"config,omitempty"` JobIds []string `json:"jobs,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` }
type BatchProposal ¶
type BatchProposal struct { Id string `json:"_id,omitempty" bson:"_id"` GearId string `json:"gear_id,omitempty"` Config map[string]interface{} `json:"config,omitempty"` State string `json:"state,omitempty"` Origin *Origin `json:"origin,omitempty"` Proposal interface{} `json:"proposal,omitempty"` Ambiguous []interface{} `json:"ambiguous,omitempty"` MissingPermissions []interface{} `json:"improper_permissions,omitempty"` Matched []interface{} `json:"matched,omitempty"` NotMatched []interface{} `json:"not_matched,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` OptionalInputPolicy string `json:"optional_input_policy,omitempty"` }
type Classification ¶
type Client ¶
Client is an http and sling client capable of making flywheel requests.
func NewApiKeyClient ¶
func NewApiKeyClient(apiKey string, options ...ApiKeyClientOption) *Client
NewApiKeyClient creates a Client with the given API key and options. Passing a key with an invalid format will panic.
func (*Client) AddAcquisition ¶
func (*Client) AddAcquisitionAnalysis ¶
func (*Client) AddAcquisitionFileClassification ¶
func (c *Client) AddAcquisitionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) AddAcquisitionNote ¶
func (*Client) AddAcquisitionTag ¶
func (*Client) AddAcquisitionsToCollection ¶
func (*Client) AddAnalysisNote ¶
func (*Client) AddAnalysisTag ¶
func (*Client) AddCollection ¶
func (*Client) AddCollectionAnalysis ¶
func (*Client) AddCollectionFileClassification ¶
func (c *Client) AddCollectionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) AddCollectionNote ¶
func (*Client) AddJobLogs ¶
func (*Client) AddModality ¶
func (*Client) AddProject ¶
func (*Client) AddProjectAnalysis ¶
func (*Client) AddProjectFileClassification ¶
func (c *Client) AddProjectFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) AddProjectNote ¶
func (*Client) AddProjectTag ¶
func (*Client) AddSession ¶
func (*Client) AddSessionAnalysis ¶
func (*Client) AddSessionFileClassification ¶
func (c *Client) AddSessionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) AddSessionNote ¶
func (*Client) AddSessionTag ¶
func (*Client) AddSessionsToCollection ¶
func (*Client) ChangeJobState ¶
func (*Client) CompleteJob ¶
Post job completion details
func (*Client) CompleteUploadTicket ¶
func (*Client) CreateUploadTicket ¶
func (c *Client) CreateUploadTicket(url string, metadata []byte, files ...*UploadSource) (*TicketResponse, *http.Response, error)
CreateUploadTicket creates an upload ticket
func (*Client) DeleteAcquisition ¶
func (*Client) DeleteAcquisitionFile ¶
func (*Client) DeleteAcquisitionFileInfoFields ¶
func (*Client) DeleteAcquisitionInfoFields ¶
func (*Client) DeleteAnalysisInfoFields ¶
func (*Client) DeleteCollection ¶
func (*Client) DeleteCollectionFile ¶
func (*Client) DeleteCollectionFileInfoFields ¶
func (*Client) DeleteCollectionInfoFields ¶
func (*Client) DeleteProjectFile ¶
func (*Client) DeleteProjectFileInfoFields ¶
func (*Client) DeleteProjectInfoFields ¶
func (*Client) DeleteSessionFile ¶
func (*Client) DeleteSessionFileInfoFields ¶
func (*Client) DeleteSessionInfoFields ¶
func (*Client) DeleteUser ¶
DeleteUser will delete a user. Returns an error if user was not found or the delete did not succeed.
func (*Client) Download ¶
func (c *Client) Download(url string, progress chan<- int64, destination *DownloadSource) chan error
func (*Client) DownloadFileFromAcquisition ¶
No progress reporting
func (*Client) DownloadFileFromAnalysis ¶
No progress reporting
func (*Client) DownloadFileFromCollection ¶
No progress reporting
func (*Client) DownloadFileFromProject ¶
No progress reporting
func (*Client) DownloadFileFromSession ¶
No progress reporting
func (*Client) DownloadFromAcquisition ¶
func (*Client) DownloadFromAnalysis ¶
func (c *Client) DownloadFromAnalysis(analysisId, filename string, destination *DownloadSource) (chan int64, chan error)
func (*Client) DownloadFromCollection ¶
func (*Client) DownloadFromProject ¶
func (*Client) DownloadFromSession ¶
func (*Client) DownloadInputFileFromAnalysis ¶
No progress reporting
func (*Client) DownloadInputFromAnalysis ¶
func (c *Client) DownloadInputFromAnalysis(analysisId, filename string, destination *DownloadSource) (chan int64, chan error)
func (*Client) DownloadSimple ¶
func (c *Client) DownloadSimple(url string, destination *DownloadSource) (chan int64, chan error)
func (*Client) GetAcquisition ¶
func (*Client) GetAcquisitionDownloadUrl ¶
func (*Client) GetAllAcquisitions ¶
func (c *Client) GetAllAcquisitions() ([]*Acquisition, *http.Response, error)
func (*Client) GetAllCollections ¶
func (c *Client) GetAllCollections() ([]*Collection, *http.Response, error)
func (*Client) GetAllModalities ¶
func (*Client) GetAllProjects ¶
func (*Client) GetAllSessions ¶
func (*Client) GetAnalyses ¶
func (c *Client) GetAnalyses(cont_name string, cid string, sub_cont string) ([]*AnalysisListItem, *http.Response, error)
This may be cleaner if we had an abstract container struct
func (*Client) GetAnalysis ¶
func (*Client) GetAnalysisDownloadUrl ¶
func (*Client) GetAnalysisInputDownloadUrl ¶
func (*Client) GetAuthStatus ¶
func (c *Client) GetAuthStatus() (*AuthStatus, *http.Response, error)
GetAuthStatus validates the current credentials.
func (*Client) GetCollection ¶
func (*Client) GetCollectionAcquisitions ¶
func (*Client) GetCollectionDownloadUrl ¶
func (*Client) GetCollectionSessionAcquisitions ¶
func (*Client) GetCollectionSessions ¶
func (*Client) GetGearInvocation ¶
func (*Client) GetJobStats ¶
func (*Client) GetModality ¶
func (*Client) GetProject ¶
func (*Client) GetProjectDownloadUrl ¶
func (*Client) GetProjectSessions ¶
func (*Client) GetSession ¶
func (*Client) GetSessionAcquisitions ¶
func (*Client) GetSessionDownloadUrl ¶
func (*Client) GetTicketDownloadUrl ¶
func (c *Client) GetTicketDownloadUrl(container string, id string, filename string) (string, *http.Response, error)
GetTicketDownloadURL will generate a ticket for downloading a file outside of the SDK
func (*Client) GetTicketDownloadUrlFromUrl ¶
GetTicketDownloadURL will generate a ticket for downloading a file outside of the SDK
func (*Client) JobsAsk ¶
func (c *Client) JobsAsk(question *JobsQuestion) (*JobsAnswer, *http.Response, error)
func (*Client) ModifyAcquisition ¶
func (*Client) ModifyAcquisitionFile ¶
func (c *Client) ModifyAcquisitionFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
func (*Client) ModifyCollection ¶
func (*Client) ModifyCollectionFile ¶
func (c *Client) ModifyCollectionFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
func (*Client) ModifyGroup ¶
func (*Client) ModifyProject ¶
func (*Client) ModifyProjectFile ¶
func (c *Client) ModifyProjectFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
func (*Client) ModifySession ¶
func (*Client) ModifySessionFile ¶
func (c *Client) ModifySessionFile(id string, filename string, attributes *FileFields) (*http.Response, *ModifiedAndJobsResponse, error)
func (*Client) ModifyUser ¶
ModifyUser will update an existing user. Only set the fields of user that you want modified.
func (*Client) PrepareCompleteJob ¶
Create a job completion ticket. ref: https://github.com/flywheel-io/core/pull/1503#issue-244236118
func (*Client) ProposeBatch ¶
func (c *Client) ProposeBatch(gearId string, config map[string]interface{}, tags []string, targets []*ContainerReference, optionalInputPolicy string) (*BatchProposal, *http.Response, error)
func (*Client) RemoveAcquisitionFileClassification ¶
func (c *Client) RemoveAcquisitionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) RemoveCollectionFileClassification ¶
func (c *Client) RemoveCollectionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) RemoveProjectFileClassification ¶
func (c *Client) RemoveProjectFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) RemoveSessionFileClassification ¶
func (c *Client) RemoveSessionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) ReplaceAcquisitionFileClassification ¶
func (c *Client) ReplaceAcquisitionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) ReplaceAcquisitionFileInfo ¶
func (*Client) ReplaceAcquisitionInfo ¶
func (*Client) ReplaceAnalysisInfo ¶
func (*Client) ReplaceCollectionFileClassification ¶
func (c *Client) ReplaceCollectionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) ReplaceCollectionFileInfo ¶
func (*Client) ReplaceCollectionInfo ¶
func (*Client) ReplaceModality ¶
func (*Client) ReplaceProjectFileClassification ¶
func (c *Client) ReplaceProjectFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) ReplaceProjectFileInfo ¶
func (*Client) ReplaceProjectInfo ¶
func (*Client) ReplaceSessionFileClassification ¶
func (c *Client) ReplaceSessionFileClassification(id string, filename string, classification Classification) (*http.Response, *ModifiedAndJobsSpawned, error)
func (*Client) ReplaceSessionFileInfo ¶
func (*Client) ReplaceSessionInfo ¶
func (*Client) Search ¶
func (c *Client) Search(search_query *SearchQuery) ([]*SearchResponse, *http.Response, error)
Search runs a query, returning up to limit results.
func (*Client) SearchRaw ¶
func (c *Client) SearchRaw(search_query *SearchQuery) (*RawSearchResponseList, *http.Response, error)
SearchRaw is left in for compatibility reasons. You should probably use Search.
func (*Client) SetAcquisitionFileInfo ¶
func (*Client) SetAcquisitionInfo ¶
func (*Client) SetAnalysisInfo ¶
func (*Client) SetCollectionFileInfo ¶
func (*Client) SetCollectionInfo ¶
func (*Client) SetProjectFileInfo ¶
func (*Client) SetProjectInfo ¶
func (*Client) SetSessionFileInfo ¶
func (*Client) SetSessionInfo ¶
func (*Client) SignedUrlUpload ¶
func (c *Client) SignedUrlUpload(ticket TicketResponse, files ...*UploadSource) (chan int64, chan error)
func (*Client) StartJobs ¶
func (c *Client) StartJobs(whitelist, blacklist *JobsMatch, capabilities []string, peek bool, maxJobs int) (JobRetrieval, []*Job, *http.Response, error)
Start up to maxJobs pending jobs matching a set of properties.
func (*Client) StartNextPendingJobLegacy ¶
func (*Client) Upload ¶
func (c *Client) Upload(url string, metadata []byte, progress chan<- int64, files []*UploadSource) chan error
Upload will send a set of UploadSources to url, reporting uploaded bytes to progress if set. Upload will not block sending to progress.
Depending on the URL, metadata may be required, or only one file may be allowed at a time. It is generally a good idea to use a purpose-specific upload method.
func (*Client) UploadFileToAcquisition ¶
No progress reporting
func (*Client) UploadFileToAnalysis ¶
No progress reporting
func (*Client) UploadFileToCollection ¶
No progress reporting
func (*Client) UploadFileToProject ¶
No progress reporting
func (*Client) UploadFileToSession ¶
No progress reporting
func (*Client) UploadFilesToAnalysis ¶
No progress reporting
func (*Client) UploadSimple ¶
func (c *Client) UploadSimple(url string, metadata []byte, files ...*UploadSource) (chan int64, chan error)
UploadSimpleWithRate is a convenience wrapper around UploadWithRate.
func (*Client) UploadSimpleSignedUrl ¶
func (*Client) UploadSimpleWithRate ¶
func (c *Client) UploadSimpleWithRate(url string, metadata []byte, rate float64, files ...*UploadSource) (chan int64, chan error)
UploadSimple is a convenience wrapper around Upload. Passing 0 for rate will result in an unlimited transfer It creates the progress channel and UploadSource array for you.
func (*Client) UploadToAcquisition ¶
func (c *Client) UploadToAcquisition(id string, files ...*UploadSource) (chan int64, chan error)
func (*Client) UploadToAnalysis ¶
func (c *Client) UploadToAnalysis(id string, files ...*UploadSource) (chan int64, chan error)
func (*Client) UploadToCollection ¶
func (c *Client) UploadToCollection(id string, files ...*UploadSource) (chan int64, chan error)
func (*Client) UploadToProject ¶
func (c *Client) UploadToProject(id string, files ...*UploadSource) (chan int64, chan error)
func (*Client) UploadToSession ¶
func (c *Client) UploadToSession(id string, files ...*UploadSource) (chan int64, chan error)
func (*Client) UploadWithRate ¶
func (c *Client) UploadWithRate(url string, metadata []byte, progress chan<- int64, rate float64, files []*UploadSource) chan error
Upload with a limited transfer speed rate is an optional upload transfer limit, in MB/sec. A rate of 0 will result in an unlimited upload
type Collection ¶
type Collection struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty" bson:"name"` Curator string `json:"curator,omitempty"` Description string `json:"description,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Files []*File `json:"files,omitempty"` Notes []*Note `json:"notes,omitempty"` Info map[string]interface{} `json:"info,omitempty"` Public *bool `json:"public,omitempty"` Archived *bool `json:"archived,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` Analyses []*Analysis `json:"analyses,omitempty"` }
type Config ¶
type Config struct { // Auth holds information about how users can authenticate. // // NOTE: this can go one layer deeper after multi-auth. // https://github.com/scitran/core/pull/652 Auth map[string]interface{} `json:"auth"` // Site holds multi-site registration information. // This feature is depreciated. Site map[string]interface{} `json:"site"` // Set of features advertised by core Features map[string]bool `json:"features",omitempty"` Created time.Time `json:"created"` Modified time.Time `json:"modified"` }
Config represents some of the server's configuration.
type ContainerReference ¶
type DebugTransport ¶
type DebugTransport struct { // All requests made with this transport will be written to Writer. // It will default to os.Stderr if nil. Writer io.Writer // Transport is the underlying HTTP transport to use when making requests. // It will default to http.DefaultTransport if nil. Transport http.RoundTripper }
DebugTransport prints its raw requests and responses to a writer, including bodies.
func (*DebugTransport) Client ¶
func (t *DebugTransport) Client() *http.Client
Client returns an *http.Client which uses the DebugTransport.
type DeletedResponse ¶
type DeletedResponse struct {
DeletedCount int `json:"deleted"`
}
DeleteResponse is used for endpoints that respond with a count of deleted objects.
type DownloadSource ¶
type DownloadSource struct { Writer io.WriteCloser Path string }
DownloadSource represents one file to upload.
It is only valid to set one of (Writer, Path). If Path is set, it will be written to disk using os.Create.
func CreateDownloadSourceFromFilename ¶
func CreateDownloadSourceFromFilename(filename string) *DownloadSource
type DownloadTicket ¶
type DownloadTicket struct {
Ticket string `json:"ticket,omitempty"`
}
DownloadTicket is retrieved when generating a download URL that does not require authentication
type Error ¶
Error is an API error. All failed server responses should be of this form. TODO: implement error interface, change coalesce
type File ¶
type File struct { Name string `json:"name,omitempty"` Origin *Origin `json:"origin,omitempty"` Size int `json:"size,omitempty"` Classification Classification `json:"classification,omitempty"` Modality string `json:"modality,omitempty"` Mimetype string `json:"mimetype,omitempty"` Type string `json:"type,omitempty"` Tags []string `json:"tags,omitempty"` Info map[string]interface{} `json:"info,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` }
type FileFields ¶
type FileReference ¶
type FileSearchResponse ¶
type Formula ¶
type Formula struct { Inputs []*Input `json:"inputs"` Target Target `json:"target"` Outputs []*Output `json:"outputs"` }
Formula describes a single unit of work.
type FormulaResult ¶
FormulaResult combines a (possibly-modified) Formula with any results.
type Gear ¶
type Gear struct { Name string `json:"name,omitempty"` Label string `json:"label,omitempty"` Description string `json:"description,omitempty"` Version string `json:"version,omitempty"` Flywheel string `json:"flywheel,omitempty"` Inputs map[string]map[string]interface{} `json:"inputs"` Config map[string]map[string]interface{} `json:"config"` Environment map[string]string `json:"environment,omitempty"` Command string `json:"command,omitempty"` Author string `json:"author,omitempty"` Maintainer string `json:"maintainer,omitempty"` Cite string `json:"cite,omitempty"` License string `json:"license,omitempty"` Source string `json:"source"` Url string `json:"url"` Custom map[string]interface{} `json:"custom,omitempty"` }
type GearCategory ¶
type GearCategory string
Enum for gear categories. Gear categories mainly affect how they are displayed in the user interfaces.
const ( UtilityGear GearCategory = "utility" AnalysisGear GearCategory = "analysis" // Legacy category; equivalent to Utility ConverterGear GearCategory = "converter" // Legacy category; equivalent to Utility QaGear GearCategory = "qa" )
type GearDoc ¶
type GearDoc struct { Id string `json:"_id,omitempty" bson:"_id"` Category GearCategory `json:"category,omitempty"` Gear *Gear `json:"gear,omitempty"` Source *GearSource `json:"exchange,omitempty"` Projects []string `json:"projects,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` }
type GearSource ¶
type Group ¶
type Group struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty" bson:"label"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Tags []string `json:"tags,omitempty"` // Permissions array is called roles on groups, and groups only // https://github.com/scitran/core/issues/662 Permissions []*Permission `json:"permissions,omitempty"` }
type GroupSearchResponse ¶
type IdResponse ¶
type IdResponse struct {
Id string `json:"_id"`
}
IdResponse is used for endpoints that respond with an Id.
type Input ¶
type Input struct { Type string `json:"type,omitempty"` URI string `json:"uri,omitempty"` Location string `json:"location,omitempty"` VuID string `json:"vu,omitempty"` }
Input describes an asset that must be present for the formula to execute.
type Job ¶
type Job struct { Id string `json:"id,omitempty" bson:"_id"` GearId string `json:"gear_id,omitempty" bson:"gear_id"` State JobState `json:"state,omitempty"` Attempt int `json:"attempt,omitempty"` Origin *Origin `json:"origin,omitempty"` FailureReason string `json:"failure_reason"` Config map[string]interface{} `json:"config,omitempty"` Inputs map[string]interface{} `json:"inputs,omitempty"` Destination *ContainerReference `json:"destination,omitempty"` Tags []string `json:"tags,omitempty"` Request *Formula `json:"request,omitempty"` ResultMetadata map[string]interface{} `json:"produced_metadata,omitempty"` ResultFiles []string `json:"saved_files,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` // Obsoleted by https://github.com/flywheel-io/core/pull/1446 OldProfile *ObsoleteJobProfile `json:"profile,omitempty"` Profile *JobProfile `json:"profile,omitempty" bson:"profile"` }
type JobCompletion ¶
type JobCompletion struct { // Whether or not the job ran successfully Success bool `json:"success"` // If Success is false, the suspected reason for the failure FailureReason string `json:"failure_reason,omitempty"` // Job profile information Profile *JobProfile `json:"profile,omitempty"` }
type JobCompletionTicket ¶
type JobCompletionTicket struct { // Success and Elapsed are expected by the legacy version of the endpoint // Obsoleted by https://github.com/flywheel-io/core/pull/1503 Success bool `json:"success,omitempty"` Elapsed int64 `json:"elapsed,omitempty"` }
type JobCompletionTicketResponse ¶
type JobCompletionTicketResponse struct { // The ticket reference string Ticket string `json:"ticket,omitempty"` }
JobTicket is returned when creating a JobCompletionTicket
type JobExecutorProfile ¶
type JobExecutorProfile struct { // A machine or instance name, possibly a FQDN Name string `json:"name,omitempty"` // The hostname or (more likely) IP address of the engine instance Host string `json:"host,omitempty"` // A free form string describing the instance type InstanceType string `json:"instance_type,omitempty"` // The number of CPU cores CpuCores int `json:"cpu_cores,omitempty"` // Whether or not a GPU is available Gpu bool `json:"gpu,omitempty"` // The amount of memory on the system, in bytes MemoryBytes int64 `json:"memory_bytes,omitempty"` // The size of the hard disk on the system, in bytes DiskBytes int64 `json:"disk_bytes,omitempty"` // The available swap space, in bytes SwapBytes int64 `json:"swap_bytes,omitempty"` }
func CreateLocalJobExecutorProfile ¶
func CreateLocalJobExecutorProfile() *JobExecutorProfile
Returns a JobExecutorProfile with some of its fields filled in.
type JobLog ¶
type JobLog struct { Id string `json:"_id,omitempty"` Logs []*JobLogStatement `json:"logs,omitempty"` }
type JobLogStatement ¶
type JobLogStatement struct { // The file descriptor the log line came from. // Negative values are external logs from Flywheel components; // One is standard out; // Two is standard err; // Other values are invalid. FileDescriptor int8 `json:"fd"` // The message for this statement. Typically newline-delimited. Message string `json:"msg"` }
type JobProfile ¶
type JobProfile struct { // The number of input files TotalInputFiles int64 `json:"total_input_files,omitempty"` // The combined size of all input files (bytes) TotalInputSizeBytes int64 `json:"total_input_size_bytes,omitempty"` // The number of output files TotalOutput_files int64 `json:"total_output_files,omitempty"` // The combined size of all output files (bytes) TotalOutput_sizeBytes int64 `json:"total_output_size_bytes,omitempty"` // The length of time taken to download gear container and inputs (ms) PreparationTimeMs int64 `json:"preparation_time_ms,omitempty"` // The runtime of the job (ms) ElapsedTimeMs int64 `json:"elapsed_time_ms,omitempty" bson:"elapsed_time_ms"` // The length of time taken to upload the job's outputs (ms) UploadTimeMs int64 `json:"upload_time_ms,omitempty"` // The total length of time from start to finish (ms) TotalTimeMs int64 `json:"total_time_ms,omitempty"` // Information about the job executor Executor *JobExecutorProfile `json:"executor,omitempty"` // Known version info for components involved in the job Versions map[string]string `json:"version,omitempty"` }
type JobRetrieval ¶
type JobRetrieval int
Enum for job retrieval attempts.
const ( JobsAquired JobRetrieval = iota NoPendingJobs JobFailure )
type JobStateCount ¶
type JobStateCount struct { Pending int `json:"pending"` Running int `json:"running"` Failed int `json:"failed"` Complete int `json:"complete"` Cancelled int `json:"cancelled"` }
A count of jobs in each state.
type JobsAnswer ¶
type JobsAnswer struct { Jobs []*Job `json:"jobs"` States *JobStateCount `json:"states"` }
type JobsAskType ¶
type JobsQuestion ¶
type JobsQuestion struct { Whitelist *JobsMatch `json:"whitelist"` Blacklist *JobsMatch `json:"blacklist"` Capabilities []string `json:"capabilities"` Return *JobsAskType `json:"return,omitempty"` }
type Key ¶
type Key struct { Key string `json:"key"` Created *time.Time `json:"created"` LastUsed *time.Time `json:"last_used"` }
Key is an API key, saved on a User to access the API.
type Modality ¶
type Modality struct { Id string `json:"_id",omitempty"` Classification Classification `json:"classification,omitempty"` }
type ModifiedAndJobsResponse ¶
type ModifiedAndJobsResponse struct { ModifiedCount int `json:"modified"` JobsTriggered int `json:"jobs_triggered"` }
ModifiedAndJobsResponse is used for endpoints that respond with a count of modified objects.
type ModifiedAndJobsSpawned ¶
type ModifiedAndJobsSpawned struct { ModifiedCount int `json:"modified"` JobsSpawned int `json:"jobs_spawned"` }
ModifiedAndJobsSpawned for when api responds with jobs spawned instead of triggered
type ModifiedResponse ¶
type ModifiedResponse struct {
ModifiedCount int `json:"modified"`
}
ModifiedResponse is used for endpoints that respond with a count of modified objects.
type ObsoleteJobProfile ¶
type ObsoleteJobProfile struct {
Elapsed int64 `json:"elapsed, omitempty"`
}
type Origin ¶
type Origin struct { Id string `json:"id,omitempty"` Method string `json:"method,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` // Some origins may, in turn, hold an origin. // The parent origin is considered to be more "canonical" than the one it contains. // For example, one origin might be User A via Job B. Via *Origin `json:"via,omitempty"` }
type Output ¶
type Output struct { Type string `json:"type,omitempty"` URI string `json:"uri,omitempty"` Location string `json:"location,omitempty"` VuID string `json:"vu,omitempty"` }
Output describes the creation of an asset after a formula is complete.
type ParentSearchResponse ¶
type Permission ¶
Permission represents the capability of a single user on a given container. Many containers have an array of these permissions, and they are frequently casscaded down the container hierarchy.
type ProgressReader ¶
ProgressReader wraps a reader and reports its progress. A ProgressReader must be created by NewProgressReader.
func NewProgressReader ¶
func NewProgressReader(r io.Reader, p chan<- int64) *ProgressReader
NewProgressReader returns a new ProgressReader that wraps r and reports to p.
The returned ProgressReader will not block sending to p. It is required to eventually Close() ProgressReader, which will also close p.
func (*ProgressReader) Close ¶
func (r *ProgressReader) Close() error
Close implements io.Closer. Subsequent calls are ignored.
func (*ProgressReader) Read ¶
func (r *ProgressReader) Read(p []byte) (int, error)
Read implements io.Reader.
func (*ProgressReader) SetReader ¶
func (r *ProgressReader) SetReader(newReader io.Reader)
Read implements io.Reader.
func (*ProgressReader) Update ¶
func (r *ProgressReader) Update()
Update reports the bytes read to the progress channel.
By default, ProgressReader will call Update periodically when more bytes have been written. Update is also called after Close, which will report the final total.
Will not block. Manual calls to this function after Close() will panic.
type Project ¶
type Project struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty" bson:"label"` GroupId string `json:"group,omitempty"` Description string `json:"description,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Files []*File `json:"files,omitempty"` Notes []*Note `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` Info map[string]interface{} `json:"info,omitempty"` Public *bool `json:"public,omitempty"` Deleted *time.Time `json:"deleted,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` }
type ProjectSearchResponse ¶
type RawSearchResponse ¶
type RawSearchResponse struct { Id string `json:"_id"` Source *SearchResponse `json:"_source,omitempty"` }
SearchResponse is used for endpoints of data_explorer
type RawSearchResponseList ¶
type RawSearchResponseList struct {
Results []*RawSearchResponse `json:"results,omitempty"`
}
Because the endpoint returns a key results which is a list of responses
type Result ¶
type Result struct {
ExitCode int `json:"exitcode"`
}
Result describes the result of a formula.
type RootModeQueryStruct ¶
type RootModeQueryStruct struct {
Root bool `url:"root,omitempty"`
}
type SearchQuery ¶
type SearchQuery struct { // ReturnType sets the type of search results. ReturnType SearchType `json:"return_type"` // SearchString represents the search query. SearchString string `json:"search_string,omitempty"` // Limit determines the maximum number of search results. // Set to a negative value to return all results. Set to zero to use a default limit. Limit int `json:"limit,omitempty"` // IncludeInaccessible, when set, will include data that the current user does not have access to read. IncludeInaccessible bool `json:"all_data,omitempty"` // Filters is a set of ElasticSearch filters to use in the search. // https://www.elastic.co/guide/en/elasticsearch/reference/current/term-level-queries.html Filters []interface{} `json:"filters,omitempty"` }
type SearchResponse ¶
type SearchResponse struct { Project *ProjectSearchResponse `json:"project,omitempty"` Group *GroupSearchResponse `json:"group,omitempty"` Session *SessionSearchResponse `json:"session,omitempty"` Acquisition *AcquisitionSearchResponse `json:"acquisition,omitempty"` Subject *SubjectSearchResponse `json:"subject,omitempty"` File *FileSearchResponse `json:"file,omitempty"` Collection *CollectionSearchResponse `json:"collection,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` Analysis *AnalysisSearchResponse `json:"analysis,omitempty"` Parent *ParentSearchResponse `json:"parent,omitempty"` }
SearchResponse for the SearchResponse
type SearchType ¶
type SearchType string
Enum for Return Types.
const ( FileString SearchType = "file" AcquisitionString SearchType = "acquisition" SessionString SearchType = "session" AnalysisString SearchType = "analysis" CollectionString SearchType = "collection" )
type Session ¶
type Session struct { Id string `json:"_id,omitempty" bson:"_id"` Name string `json:"label,omitempty" bson:"label"` GroupId string `json:"group,omitempty"` ProjectId string `json:"project,omitempty"` Subject *Subject `json:"subject,omitempty"` Timestamp *time.Time `json:"timestamp,omitempty"` Timezone string `json:"timezone,omitempty"` Uid string `json:"uid,omitempty"` Notes []*Note `json:"notes,omitempty"` Tags []string `json:"tags,omitempty"` Info map[string]interface{} `json:"info,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` Files []*File `json:"files,omitempty"` Public bool `json:"public,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` Deleted *time.Time `json:"deleted,omitempty"` Analyses []*Analysis `json:"analyses,omitempty"` }
type SessionSearchResponse ¶
type Subject ¶
type Subject struct { Id string `json:"_id,omitempty" bson:"_id"` Code string `json:"code,omitempty"` Firstname string `json:"firstname,omitempty"` Lastname string `json:"lastname,omitempty"` Sex string `json:"sex,omitempty"` Age int `json:"age,omitempty"` Info map[string]interface{} `json:"info,omitempty"` ProjectId string `json:"project,omitempty"` Files []*File `json:"files,omitempty"` Permissions []*Permission `json:"permissions,omitempty"` }
type SubjectSearchResponse ¶
type SubjectSearchResponse struct {
Code string `json:"code,omitempty"`
}
type Target ¶
type Target struct { Command []string `json:"command,omitempty"` Env map[string]string `json:"env,omitempty"` Dir string `json:"dir,omitempty"` Uid uint32 `json:"uid,omitempty"` Gid uint32 `json:"gid,omitempty"` }
Target describes what the formula will execute.
type TicketResponse ¶
type UploadBody ¶
type UploadResponse ¶
Bundle an http response and error together for returning over a channel
type UploadSource ¶
type UploadSource struct { Name string Reader io.ReadCloser Path string }
UploadSource represents one file to upload.
It is only valid to set one of (Reader, Path). If Path is set, it will be read off disk using os.Open.
If Name is not set, then filepath.Base(Path) will be used.
func CreateUploadSourceFromFilenames ¶
func CreateUploadSourceFromFilenames(filenames ...string) []*UploadSource
type User ¶
type User struct { Id string `json:"_id,omitempty" bson:"_id"` Email string `json:"email,omitempty"` Firstname string `json:"firstname,omitempty"` Lastname string `json:"lastname,omitempty"` ApiKey *Key `json:"api_key,omitempty"` Avatar string `json:"avatar,omitempty"` Avatars map[string]string `json:"avatars,omitempty"` Created *time.Time `json:"created,omitempty"` Modified *time.Time `json:"modified,omitempty"` RootAccess *bool `json:"root,omitempty"` Roles []string `json:"roles,omitempty"` }
User represents a single user.