nmdc

package
v0.0.0-...-01f40ff Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase() (databases.Database, error)

Types

type CreditAssociation

type CreditAssociation struct {
	Roles  []string    `json:"applied_roles"`
	Person PersonValue `json:"applies_to_person"`
	Type   string      `json:"type,omitempty"`
}

https://microbiomedata.github.io/nmdc-schema/CreditAssociation/

type DataObject

type DataObject struct {
	FileSizeBytes          int      `json:"file_size_bytes"`
	MD5Checksum            string   `json:"md5_checksum"`
	DataObjectType         string   `json:"data_object_type"`
	CompressionType        string   `json:"compression_type"`
	URL                    string   `json:"url"`
	Type                   string   `json:"type"`
	Id                     string   `json:"id"`
	Name                   string   `json:"name"`
	Description            string   `json:"description"`
	WasGeneratedBy         string   `json:"was_generated_by"`
	AlternativeIdentifiers []string `json:"alternative_identifiers,omitempty"`
}

data object type for JSON marshalling (see https://microbiomedata.github.io/nmdc-schema/DataObject/)

type Database

type Database struct {
	// HTTP client that caches queries
	Client http.Client
	// authorization info
	Auth authorization
	// mapping of host URLs to endpoints
	EndpointForHost map[string]string
}

file database appropriate for handling searches and transfers (implements the databases.Database interface)

func (Database) Descriptors

func (db Database) Descriptors(orcid string, fileIds []string) ([]map[string]any, error)

func (*Database) Finalize

func (db *Database) Finalize(orcid string, id uuid.UUID) error

func (*Database) Load

func (db *Database) Load(state databases.DatabaseSaveState) error

func (Database) LocalUser

func (db Database) LocalUser(orcid string) (string, error)

func (Database) Save

func (*Database) Search

func (db *Database) Search(orcid string, params databases.SearchParameters) (databases.SearchResults, error)

func (Database) SpecificSearchParameters

func (db Database) SpecificSearchParameters() map[string]any

func (Database) StageFiles

func (db Database) StageFiles(orcid string, fileIds []string) (uuid.UUID, error)

func (Database) StagingStatus

func (db Database) StagingStatus(id uuid.UUID) (databases.StagingStatus, error)

type Doi

type Doi struct {
	Value    string `json:"doi_value"`
	Provider string `json:"doi_provider,omitempty"`
	Category string `json:"doi_category"`
}

https://microbiomedata.github.io/nmdc-schema/Doi/

type PersonValue

type PersonValue struct {
	Email    string   `json:"email,omitempty"`
	Name     string   `json:"name,omitempty"`
	Orcid    string   `json:"orcid,omitempty"`
	Websites []string `json:"websites,omitempty"`
	RawValue string   `json:"has_raw_value,omitempty"` // name in 'FIRST LAST' format (if present)
}

https://microbiomedata.github.io/nmdc-schema/PersonValue/

type Study

type Study struct {
	Id                 string              `json:"id"`
	AlternativeNames   []string            `json:"alternative_names,omitempty"`
	AlternativeTitles  []string            `json:"alternative_titles,omitempty"`
	AssociatedDois     []Doi               `json:"associated_dois,omitempty"`
	Description        string              `json:"description,omitempty"`
	FundingSources     []string            `json:"funding_sources,omitempty"`
	CreditAssociations []CreditAssociation `json:"has_credit_associations,omitempty"`
	Name               string              `json:"name,omitempty"`
	RelatedIdentifiers string              `json:"related_identifiers,omitempty"`
	Title              string              `json:"title,omitempty"`
}

https://microbiomedata.github.io/nmdc-schema/Study/

type WorkflowExecution

type WorkflowExecution struct {
	Id         string  `json:"id"`
	Name       string  `json:"name"`
	Studies    []Study `json:"studies"`
	Biosamples []any   `json:"biosamples"`
}

https://microbiomedata.github.io/nmdc-schema/WorkflowExecution/

Jump to

Keyboard shortcuts

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