Documentation
¶
Overview ¶
Data structures used to store and version modules (code in Lua environment)
Index ¶
- func IsValidModuleName(name string) bool
- func SemanticVersionToString(v SemanticVersion) string
- type DataModule
- type DataModuleInput
- type DataModuleSpecificVersionWire
- type DataModuleVersion
- type DataModuleVersionInput
- type DataModuleVersionSourceWire
- type DataModuleVersionWire
- type DataModuleWire
- type DataModuleWireLookup
- type SemanticVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SemanticVersionToString ¶
func SemanticVersionToString(v SemanticVersion) string
Types ¶
type DataModule ¶
type DataModule struct {
ID string `json:"id" bson:"_id"` // Use as Mongo ID
Name string `json:"name"`
Comments string `json:"comments"`
Origin pixlUser.APIObjectItem `json:"origin"`
}
Stored module object itself
type DataModuleInput ¶
type DataModuleInput struct {
Name string `json:"name"` // Editable name
SourceCode string `json:"sourceCode"` // The module executable code
Comments string `json:"comments"` // Editable comments
Tags []string `json:"tags"` // Any tags for this version
DOIMetadata zenodoModels.DOIMetadata `json:"doiMetadata,omitempty" bson:"doiMetadata,omitempty"`
}
What users send in POST
type DataModuleSpecificVersionWire ¶
type DataModuleSpecificVersionWire struct {
*DataModule
Version DataModuleVersionSourceWire `json:"version"`
}
And what we send for a specific module version request
type DataModuleVersion ¶
type DataModuleVersion struct {
ID string `json:"-" bson:"_id"` // Use as Mongo ID
ModuleID string `json:"moduleID"` // The ID of the module we belong to
SourceCode string `json:"sourceCode"`
Version SemanticVersion `json:"version"`
Tags []string `json:"tags"`
Comments string `json:"comments"`
TimeStampUnixSec int64 `json:"mod_unix_time_sec"`
DOIMetadata zenodoModels.DOIMetadata `json:"doiMetadata,omitempty" bson:"doiMetadata,omitempty"`
}
Stored version of a module
type DataModuleVersionInput ¶
type DataModuleVersionInput struct {
SourceCode string `json:"sourceCode"` // The module executable code
Comments string `json:"comments"` // Editable comments
Tags []string `json:"tags"` // Any tags for this version
VersionUpdate string `json:"versionupdate"` // What are we updating? patch, minor or major. Anything else = error
DOIMetadata zenodoModels.DOIMetadata `json:"doiMetadata,omitempty" bson:"doiMetadata,omitempty"`
}
And what we get in PUT for new versions being uploaded
type DataModuleVersionSourceWire ¶
type DataModuleVersionSourceWire struct {
SourceCode string `json:"sourceCode"`
*DataModuleVersionWire
}
As above, but with source field
type DataModuleVersionWire ¶
type DataModuleVersionWire struct {
Version string `json:"version"`
Tags []string `json:"tags"`
Comments string `json:"comments"`
TimeStampUnixSec int64 `json:"mod_unix_time_sec"`
DOIMetadata zenodoModels.DOIMetadata `json:"doiMetadata,omitempty" bson:"doiMetadata,omitempty"`
}
What we send out to users - notice versions only contains version numbers & tags
type DataModuleWire ¶
type DataModuleWire struct {
*DataModule
Versions []DataModuleVersionWire `json:"versions"`
}
type DataModuleWireLookup ¶
type DataModuleWireLookup map[string]DataModuleWire
type SemanticVersion ¶
func SemanticVersionFromString ¶
func SemanticVersionFromString(v string) (SemanticVersion, error)
Click to show internal directories.
Click to hide internal directories.