modules

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidModuleName

func IsValidModuleName(name string) bool

Some validation 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
}

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"`
}

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
}

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"`
}

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

type SemanticVersion struct {
	Major int
	Minor int
	Patch int
}

func SemanticVersionFromString

func SemanticVersionFromString(v string) (SemanticVersion, error)

Jump to

Keyboard shortcuts

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