nirvash/archetype/adapter.go

40 lines
732 B
Go
Raw Normal View History

package archetype
import (
"time"
)
2022-06-07 06:59:41 +00:00
type BuildStatus struct {
Success bool
Message string
}
type Page struct {
Title string
Content string
Edited time.Time
Error string
}
2022-06-08 05:44:54 +00:00
type ConfigOption struct {
Name string
Type string
}
type Adapter interface {
Init(cfg *Config)
2022-05-29 06:26:36 +00:00
Name() string
EditableSlugs() bool
BuildOptions() []string
2022-06-08 05:44:54 +00:00
GetConfig() map[ConfigOption]string
SetConfig(map[ConfigOption]string) error
2022-05-29 06:26:36 +00:00
ListPages() map[string]string
GetPage(slug string) Page
FormatPage(raw string) string
2022-05-29 06:26:36 +00:00
FormattingHelp() string
2022-06-05 04:34:20 +00:00
CreatePage(slug, title, content string) error
SavePage(oldSlug, newSlug, title, content string) error
DeletePage(slug string) error
2022-06-07 06:59:41 +00:00
Build(buildOptions map[string][]string) BuildStatus
2022-05-29 06:26:36 +00:00
}