mirror of
https://hacklab.nilfm.cc/nirvash
synced 2024-10-22 14:01:49 +00:00
39 lines
732 B
Go
39 lines
732 B
Go
package archetype
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type BuildStatus struct {
|
|
Success bool
|
|
Message string
|
|
}
|
|
|
|
type Page struct {
|
|
Title string
|
|
Content string
|
|
Edited time.Time
|
|
Error string
|
|
}
|
|
|
|
type ConfigOption struct {
|
|
Name string
|
|
Type string
|
|
}
|
|
|
|
type Adapter interface {
|
|
Init(cfg *Config)
|
|
Name() string
|
|
EditableSlugs() bool
|
|
BuildOptions() []string
|
|
GetConfig() map[ConfigOption]string
|
|
SetConfig(map[ConfigOption]string) error
|
|
ListPages() map[string]string
|
|
GetPage(slug string) Page
|
|
FormatPage(raw string) string
|
|
FormattingHelp() string
|
|
CreatePage(slug, title, content string) error
|
|
SavePage(oldSlug, newSlug, title, content string) error
|
|
DeletePage(slug string) error
|
|
Build(buildOptions map[string][]string) BuildStatus
|
|
}
|