cmd

package
v0.0.0-...-8e2dbaa Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFs embed.FS

Functions

func CreateEnvironmentRecord

func CreateEnvironmentRecord() (dbs.EnvironmentRecord, error)

CreateEnvironmentRecord builds EnvironmentRecord from the current OS and shell environment

func Execute

func Execute() error

Execute executes the root command.

func FileInfo

func FileInfo(path string) (int64, string, error)

FileInfo return size and checksum of the file

func FileList

func FileList(dir string, pat string) []string

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

func GetSystemInfo() (string, []string, []string, error)

GetSystemInfo returns the current user name, all non-loopback IPs, and all MAC addresses.

func ReadFileContent

func ReadFileContent(fname string) (string, error)

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

type MCResponse struct {
	Data []map[string]any `json:"data"`
}

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 MapRecord

type MapRecord map[string]any

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

type MetaDataRecord struct {
	Status string     `json:"status"`
	Data   []MetaData `json:"data"`
}

MetaDataRecord represents MetaData record returned by discovery service

type MetadataParameters

type MetadataParameters struct {
	Did    string
	Schema string
}

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

type ResponseRecord struct {
	Status string `json:"status"`
	Error  string `json:"error"`
}

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

type SpecScansRecord struct {
	Status string      `json:"status"`
	Data   []SpecScans `json:"data"`
}

SpecScansRecord represents SpecScans record returned by discovery service

type StorageRecord

type StorageRecord struct {
	Status string `json:"status"`
	Data   any    `json:"data"`
}

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

Jump to

Keyboard shortcuts

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