Documentation
¶
Index ¶
- Variables
- func CreateEnvironmentRecord() (dbs.EnvironmentRecord, error)
- func Execute() error
- func FileInfo(path string) (int64, string, error)
- func FileList(dir string, pat string) []string
- func GenerateRecord(schema []beamlines.SchemaRecord) (map[string]any, error)
- func GetOsInfo() (dbs.OsInfoRecord, error)
- func GetSystemInfo() (string, []string, []string, error)
- func ReadFileContent(fname string) (string, error)
- type DMRecord
- type DOIRecord
- type MCDataRecord
- type MCResponse
- type MLInput
- type MapRecord
- type MaterialsCommons
- type MetaData
- type MetaDataRecord
- type MetadataParameters
- type ProvenanceParameters
- type ResponseRecord
- type SpecScans
- type SpecScansRecord
- type StorageRecord
- type TokenParameters
- type UploadRecord
- type UrlParams
Constants ¶
This section is empty.
Variables ¶
var StaticFs embed.FS
Functions ¶
func CreateEnvironmentRecord ¶
func CreateEnvironmentRecord() (dbs.EnvironmentRecord, error)
CreateEnvironmentRecord builds EnvironmentRecord from the current OS and shell environment
func FileList ¶
FileList walks through the directory tree starting at dir and returns a slice of full paths of files matching the pattern pat.
func GenerateRecord ¶
func GenerateRecord(schema []beamlines.SchemaRecord) (map[string]any, error)
GenerateRecord creates a JSON object from schema records
func GetOsInfo ¶
func GetOsInfo() (dbs.OsInfoRecord, error)
GetOsInfo collects OS name, version, and kernel info from the current system.
func GetSystemInfo ¶
GetSystemInfo returns the current user name, all non-loopback IPs, and all MAC addresses.
func ReadFileContent ¶
ReadFileContent reads the content of the given file. If the file does not exist, it returns an empty string and no error. If the file exists, it returns its contents as a string.
Types ¶
type DMRecord ¶
type DMRecord struct { Name string `json:"name"` Path string `json:"path"` IsDir bool `json:"is_dir"` }
DMRecord represents DataManagement record
type DOIRecord ¶
type DOIRecord struct { Doi string `json:"doi"` DoiUrl string `json:"doi_url"` Did string `json:"did"` Description string `json:"description"` Provider string `json:"doi_provider"` Published string `json:"doi_created_at"` Public bool `json:"doi_public"` AccessMetadata bool `json:"doi_access_metadata"` }
DOIServiceResponse represents response structure of DOIService record
type MCDataRecord ¶
type MCDataRecord struct { Status string `json:"status"` Data []MaterialsCommons `json:"data"` }
MetaDataRecord represents MetaData record returned by discovery service
type MCResponse ¶
MCResponse represents HTTP response from Material Commons API
type MLInput ¶
type MLInput struct { Model string `json:"model"` Type string `json:"type"` Backend string `json:"backend"` File string `json:"file",omitempty` Version string `json:"version",omitempty` }
MLInput represents input for predict API
type MaterialsCommons ¶
type MaterialsCommons struct { ID string `json:"id"` Site string `json:"site"` Description string `json:"description"` Tags []string `json:"tags"` Bucket string `json:"bucket"` }
helper function to get metadata MaterialsCommons represents MaterialsCommons object returned from discovery service
type MetaData ¶
type MetaData struct { ID string `json:"id"` Site string `json:"site"` Description string `json:"description"` Tags []string `json:"tags"` Bucket string `json:"bucket"` }
helper function to get metadata MetaData represents MetaData object returned from discovery service
type MetaDataRecord ¶
MetaDataRecord represents MetaData record returned by discovery service
type MetadataParameters ¶
MetadataParameters holds all parameters we may need to generate metadata record
type ProvenanceParameters ¶
type ProvenanceParameters struct { Did string App string ConfigFile string InputDir string InputFilePattern string OutputDir string OutputFilePattern string InputFileList string OutputFileList string }
ProvenanceParameters holds all parameters we may need to generate provenance record
type ResponseRecord ¶
ResponseRecord represents MetaData record returned by discovery service
type SpecScans ¶
type SpecScans struct { ID string `json:"id"` Site string `json:"site"` Description string `json:"description"` Tags []string `json:"tags"` Bucket string `json:"bucket"` }
helper function to get specdata SpecScans represents SpecScans object returned from discovery service
type SpecScansRecord ¶
SpecScansRecord represents SpecScans record returned by discovery service
type StorageRecord ¶
StorageRecord represents Storage record returned by datamanagement service
type TokenParameters ¶
type TokenParameters struct { Alg string Iss string Sub string Aud string CustomClaims map[string]any ExpirationMinutes int Secret string PrivateKeyPath string }
TokenParameters holds all input parameters to generate fake token
type UploadRecord ¶
type UploadRecord struct { Status string `json:"status"` Error string `json:"error"` Msg string `json:"msg"` Object any `json:"object"` }
UploadRecord represents Storage record returned by datamanagement service
type UrlParams ¶
type UrlParams struct { Did string `url:"did"` File string `url:"file"` Script string `url:"script"` Environment string `url:"environment"` Package string `url:"package"` Site string `url:"site"` Bucket string `url:"bucket"` Processing string `url:"processing"` Osname string `url:"osname"` }
UrlParams represents all possible parameters we can pass to datasets query