store

package
v0.0.0-...-d19cf4f Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Week

func Week() int

Types

type Editor

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

func NewEditor

func NewEditor(s Store) *Editor

func (*Editor) Create

func (e *Editor) Create(templateName, pathToTemplate string, useSampleTemplate bool) error

func (*Editor) Delete

func (e *Editor) Delete(templateName string) error

func (*Editor) Edit

func (e *Editor) Edit(templateName string) error

func (*Editor) List

func (e *Editor) List() error

func (*Editor) New

func (e *Editor) New(fileName, filePath, templateName string, useNextWeek bool) error

type FileStore

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

func NewFileStore

func NewFileStore(basePath string, fileSystem afero.Fs) *FileStore

func (*FileStore) CreateFile

func (fstore *FileStore) CreateFile(fileName, filePath string) (afero.File, error)

func (*FileStore) CreateTemplate

func (fstore *FileStore) CreateTemplate(templateName, pathToTemplate string, useSample bool) error

func (*FileStore) DeleteTemplate

func (fstore *FileStore) DeleteTemplate(templateName string) error

func (*FileStore) EditTemplate

func (fstore *FileStore) EditTemplate(templateName string) error

func (*FileStore) GetPathToTemplate

func (fstore *FileStore) GetPathToTemplate(templateName string) string

func (*FileStore) ListTemplates

func (fstore *FileStore) ListTemplates() ([]os.FileInfo, error)

type Store

type Store interface {
	CreateTemplate(templateName, pathToTemplate string, useSample bool) error
	DeleteTemplate(templateName string) error
	GetPathToTemplate(templateName string) string
	ListTemplates() ([]os.FileInfo, error)
	CreateFile(fileName, filePath string) (afero.File, error)
}

Jump to

Keyboard shortcuts

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