store

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParsingConfig = fmt.Errorf("error parsing theme.json")

ErrParsingConfig is returned when theme.json cannot be parsed

Functions

func StripData added in v0.3.0

func StripData(in *models.Theme) *models.Theme

Types

type Theme

type Theme interface {
	// Ref returns the current ref of the theme, if valid
	Ref() (string, bool)

	// Proto returns the underlying theme proto
	Proto() *models.Theme

	// GetTemplate returns the given template. Return nil, nil if template does not exist.
	GetTemplate(templateName string) (*models.ThemeTemplate, error)

	// GetAsset returns the given asset. Return nil, nil if asset does not exist.
	GetAsset(assetName string) (*models.ThemeAsset, error)
}

type ThemeStore

type ThemeStore interface {
	// List all themes in the store
	List() ([]*models.Theme, error)

	// Add a theme from a theme file
	Add(*models.Theme) error

	AddPackage(*packages.Package) error

	// Get a theme by name from the store and the current ref
	Get(string) (Theme, error)

	// Get an asset from the store
	GetAsset(asset string) (*models.ThemeAsset, error)
}

ThemeStore is a interface to support multiple theme backends.

Jump to

Keyboard shortcuts

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