Documentation ¶
Overview ¶
Package manifest provides structures and primitives to define apps.
Index ¶
- Constants
- func GenerateDirName(name string) string
- func GenerateFileName(name string) string
- func GenerateID(name string) string
- func ValidateAuthor(author string) error
- func ValidateDesc(desc string) error
- func ValidateID(id string) error
- func ValidateName(name 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 GenerateDirName ¶ added in v0.32.0
GenerateDirName creates a suitable directory name from an app name.
func GenerateFileName ¶
GenerateFileName creates a suitable file name for the starlark source.
func GenerateID ¶
GenerateID creates a suitable ID 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 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 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"` // 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.