Documentation
¶
Index ¶
- func DuplicateFileIds(transferRequest TransferRequest) []string
- type DatabaseOutput
- type DatabaseResponse
- type DatabasesOutput
- type FileMetadataOutput
- type FileMetadataResponse
- type SearchDatabaseInput
- type SearchDatabaseInputWithoutHeader
- type SearchParametersOutput
- type SearchResultsOutput
- type SearchResultsResponse
- type ServiceInfoOutput
- type ServiceInfoResponse
- type TaskDeletionOutput
- type TransferOutput
- type TransferRecordsOutput
- type TransferRequest
- type TransferResponse
- type TransferService
- type TransferStatusOutput
- type TransferStatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DuplicateFileIds ¶
func DuplicateFileIds(transferRequest TransferRequest) []string
returns a string slice containing file IDs in the TransferRequest that have duplicates, or nil if no duplicates are found
Types ¶
type DatabaseOutput ¶
type DatabaseOutput struct {
Body DatabaseResponse `doc:"Information about the requested available database"`
}
type DatabaseResponse ¶
type DatabaseResponse struct {
Id string `json:"id" example:"jdp" `
Name string `json:"name" example:"JGI Data portal"`
Organization string `json:"organization" example:"Joint Genome Institute"`
URL string `json:"url" example:"https://data.jgi.doe.gov"`
}
a response for a database-related query (GET)
type DatabasesOutput ¶
type DatabasesOutput struct {
Body []DatabaseResponse `doc:"A list of information about available databases"`
}
type FileMetadataOutput ¶
type FileMetadataOutput struct {
Body FileMetadataResponse `doc:"Metadata for files with the given IDs"`
}
type FileMetadataResponse ¶
type FileMetadataResponse struct {
// name of organization database
Database string `json:"database" example:"jdp" doc:"the database searched"`
// resources corresponding to given file IDs
Descriptors []map[string]any `json:"resources" doc:"an array of validated Frictionless descriptors"`
}
a response for a file metadata query (GET)
type SearchDatabaseInput ¶
type SearchDatabaseInput struct {
Authorization string `header:"authorization" doc:"Authorization header with encoded access token"`
SearchDatabaseInputWithoutHeader
}
type SearchDatabaseInputWithoutHeader ¶
type SearchDatabaseInputWithoutHeader struct {
Database string `json:"database" query:"database" example:"jdp" doc:"The ID of the database to search"`
Orcid string `json:"orcid" query:"orcid" example:"1234-5678-9101=112X" doc:"The ORCID of the user searching for files"`
Query string `json:"query" query:"query" example:"prochlorococcus" doc:"A query used to search the database for matching files"`
Status string `json:"status" query:"status" example:"\"staged\"" doc:"(Optional) The staged or unstaged status of the desired files"`
Offset int `json:"offset" query:"offset" example:"100" doc:"Search results begin at the given offset"`
Limit int `json:"limit" query:"limit" example:"50" doc:"Limits the number of search results returned"`
}
type SearchParametersOutput ¶
type SearchResultsOutput ¶
type SearchResultsOutput struct {
Body SearchResultsResponse `doc:"Search results containing matching files that match the given query"`
}
type SearchResultsResponse ¶
type SearchResultsResponse struct {
// name of organization database
Database string `json:"database" example:"jdp" doc:"the database searched"`
// ElasticSearch query string
Query string `json:"query" example:"prochlorococcus" doc:"the given query string"`
// resources matching the query
Descriptors []map[string]any `json:"resources" doc:"an array of validated Frictionless descriptors"`
}
a response for a file search query (GET)
type ServiceInfoOutput ¶
type ServiceInfoOutput struct {
Body ServiceInfoResponse `doc:"information about the service itself"`
}
type ServiceInfoResponse ¶
type ServiceInfoResponse struct {
Name string `json:"name" example:"DTS" doc:"The name of the service API"`
Version string `json:"version" example:"1.0.0" doc:"The version string (major.minor.patch)"`
Uptime int `json:"uptime" example:"345600" doc:"The time the service has been up (seconds)"`
Documentation string `json:"documentation" example:"/docs" doc:"The OpenAPI documentation endpoint"`
}
this type encodes a JSON object for responding to root queries
type TaskDeletionOutput ¶
type TaskDeletionOutput struct {
Status int
}
type TransferOutput ¶
type TransferOutput struct {
Body TransferResponse `doc:"A UUID for the requested transfer"`
Status int
}
type TransferRecordsOutput ¶
type TransferRequest ¶
type TransferRequest struct {
// user ORCID
Orcid string `json:"orcid" example:"0000-0002-9227-8514" doc:"ORCID for user requesting transfer"`
// name of source database
Source string `json:"source" example:"jdp" doc:"source database identifier"`
// identifiers for files to be transferred
FileIds []string `json:"file_ids" example:"[\"fileid1\", \"fileid2\"]" doc:"source-specific identifiers for files to be transferred"`
// name of destination database
Destination string `json:"destination" example:"kbase" doc:"destination database identifier"`
// a Markdown description of the transfer request
Description string `json:"description,omitempty" example:"# title\n* type: assembly\n" doc:"Markdown task description"`
// machine-readable instructions for processing a payload at the destination site
Instructions map[string]any `` /* 126-byte string literal not displayed */
}
a request for a file transfer (POST)
type TransferResponse ¶
type TransferResponse struct {
// transfer job ID
Id uuid.UUID `json:"id" doc:"a UUID for the requested transfer"`
}
a response for a file transfer request (POST)
type TransferService ¶
type TransferService interface {
// Configures and starts the service, returning an error that indicates success or failure.
Start(conf config.Config) error
// Gracefully shuts down the service without interrupting active connections.
Shutdown(ctx context.Context) error
// Closes down the service, freeing all resources.
Close()
}
TransferService defines the interface for our data transfer service.
func NewDTSPrototype ¶
func NewDTSPrototype() (TransferService, error)
constructs a prototype file transfer service given our configuration
type TransferStatusOutput ¶
type TransferStatusOutput struct {
Body TransferStatusResponse `doc:"A status message for the transfer task with the given ID"`
}
type TransferStatusResponse ¶
type TransferStatusResponse struct {
// transfer job ID
Id string `json:"id"`
// transfer job status
Status string `json:"status"`
// message (if any) related to status
Message string `json:"message,omitempty"`
// number of files being transferred
NumFiles int `json:"num_files"`
// number of files that have been completely transferred
NumFilesTransferred int `json:"num_files_transferred"`
}
a response for a file transfer status request (GET)
Click to show internal directories.
Click to hide internal directories.