filestore

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

FileStore stores and loads templates on the filesystem

func New

func New(baseDir string, updateInterval time.Duration, logger func(args ...interface{})) (*FileStore, error)

New returns a new file store which updates periodically

func (*FileStore) Add

func (f *FileStore) Add(theme *models.Theme) error

Add a theme directly to the themeDir.

func (*FileStore) AddPackage added in v0.2.0

func (f *FileStore) AddPackage(p *packages.Package) error

AddPackage adds a theme from a theme file by cloning it from the VCS location to the themeDir.

func (*FileStore) Get

func (f *FileStore) Get(themeName string) (store.Theme, error)

Get a theme from the file store. Template and asset data (i.e. the file contents) are NOT loaded.

func (*FileStore) GetAsset

func (f *FileStore) GetAsset(assetName string) (*models.ThemeAsset, error)

func (*FileStore) List

func (f *FileStore) List() ([]*models.Theme, error)

List all themes in the store

func (*FileStore) UpdateThemeToRef added in v0.2.0

func (f *FileStore) UpdateThemeToRef(themeName, commitHash string) error

type Theme added in v0.2.0

type Theme struct {
	*models.Theme
	// contains filtered or unexported fields
}

func (*Theme) GetAsset added in v0.2.0

func (t *Theme) GetAsset(assetName string) (*models.ThemeAsset, error)

func (*Theme) GetTemplate added in v0.2.0

func (t *Theme) GetTemplate(templateName string) (*models.ThemeTemplate, error)

func (*Theme) Proto added in v0.2.0

func (t *Theme) Proto() *models.Theme

func (*Theme) Ref added in v0.2.0

func (t *Theme) Ref() (string, bool)

Jump to

Keyboard shortcuts

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