nirvash/archetype/adapter.go

48 lines
895 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
}
2023-10-21 04:46:37 +00:00
type DeployStatus BuildStatus
type RevertStatus BuildStatus
type Page struct {
Title string
Content string
Edited time.Time
Error string
}
2022-06-08 05:44:54 +00:00
type ConfigOption struct {
2024-10-27 19:43:17 +00:00
Name string
Type string
Hidden bool
2022-06-08 05:44:54 +00:00
}
type BuildOption ConfigOption
type Adapter interface {
Init(cfg *Config)
2022-05-29 06:26:36 +00:00
Name() string
EditableSlugs() bool
BuildOptions() []BuildOption
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
Build(buildOptions map[BuildOption]string) BuildStatus
2023-10-21 04:46:37 +00:00
Deploy() DeployStatus
Revert() RevertStatus
2022-05-29 06:26:36 +00:00
}