services

package
v0.0.0-...-cea2163 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
	Resources []frictionless.DataResource `json:"resources" doc:"an array of Frictionless DataResources"`
}

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"`
	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 SearchParametersOutput struct {
	Body json.RawMessage `doc:"a JSON object whose fields are search parameters and whose values indicate their type"`
}

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
	Resources []frictionless.DataResource `json:"resources" doc:"an array of Frictionless DataResources"`
}

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 TransferRequest

type TransferRequest struct {
	// 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 json.RawMessage `` /* 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 {
	// Starts the service on the selected port, returning an error that indicates
	// success or failure.
	Start(port int) 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)

Jump to

Keyboard shortcuts

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