Documentation ¶
Overview ¶
Package manifest provides structures and primitives to define apps.
Index ¶
- Constants
- func GenerateFileName(name string) string
- func GenerateID(name string) string
- func GeneratePackageName(name string) string
- func ValidateAuthor(author string) error
- func ValidateDesc(desc string) error
- func ValidateFileName(fileName string) error
- func ValidateID(id string) error
- func ValidateName(name string) error
- func ValidatePackageName(packageName string) error
- func ValidateSummary(summary string) error
- type Manifest
Constants ¶
const ( // Our longest app name to date. This can be updated, but it will need to // be tested in the mobile app. MaxNameLength = 17 // Our longest app summary to date. This can be updated, but it will need to // be tested in the mobile app. MaxSummaryLength = 27 )
const ManifestFileName = "manifest.yaml"
Variables ¶
This section is empty.
Functions ¶
func GenerateFileName ¶
GenerateFileName creates a suitable file name for the starlark source.
func GenerateID ¶
GenerateID creates a suitable ID from an app name.
func GeneratePackageName ¶
GeneratePackageName creates a suitable go package name from an app name.
func ValidateAuthor ¶
ValidateAuthor ensures the app author provided adheres to the standards for app author. We're picky here because these will display in the Tidbyt mobile app and need to display properly.
func ValidateDesc ¶
ValidateDesc ensures the app description provided adheres to the standards for app descriptions. We're picky here because these will display in the Tidbyt mobile app and need to display properly.
func ValidateFileName ¶
ValidateFileName ensures the file name appears appropriately for starlark source code.
func ValidateID ¶
ValidateID ensures the id will parse when we go to add it to our database internally.
func ValidateName ¶
ValidateName ensures the app name provided adheres to the standards for app names. We're picky here because these will display in the Tidbyt mobile app and need to display properly.
func ValidatePackageName ¶
func ValidateSummary ¶
ValidateSummary ensures the app summary provided adheres to the standards for app summaries. We're picky here because these will display in the Tidbyt mobile app and need to display properly.
Types ¶
type Manifest ¶
type Manifest struct { // ID is the unique identifier of this app. It has to be globally unique, // which means it cannot conflict with any of our private apps. ID string `json:"id" yaml:"id"` // Name is the name of the applet. Ex. "Fuzzy Clock" Name string `json:"name" yaml:"name"` // Summary is the short form of what this applet does. Ex. "Human readable // time". Summary string `json:"summary" yaml:"summary"` // Desc is the long form of what this applet does. Ex. "Display the time in // a groovy, human-readable way." Desc string `json:"desc" yaml:"desc"` // Author is the person or organization who contributed this applet. Ex, // "Max Timkovich" Author string `json:"author" yaml:"author"` // FileName is the name of the starlark source file. FileName string `json:"fileName" yaml:"fileName"` // PackageName is the name of the go package where this app lives. PackageName string `json:"packageName" yaml:"packageName"` // Source is the starlark source code for this applet using the go `embed` // module. Source []byte `json:"-" yaml:"-"` }
Manifest is a structure to define a starlark applet for Tidbyt in Go.
func LoadManifest ¶
LoadManifest reads a manifest from an io.Reader, with the most common reader being a file from os.Open. It returns a manifest or an error if it could not be parsed.