2022-05-31 05:38:51 +00:00
|
|
|
package archetype
|
2022-05-29 04:45:44 +00:00
|
|
|
|
2022-06-09 05:13:09 +00:00
|
|
|
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
|
|
|
|
|
2022-06-09 05:13:09 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-06-18 06:17:08 +00:00
|
|
|
type BuildOption ConfigOption
|
|
|
|
|
2022-05-29 04:45:44 +00:00
|
|
|
type Adapter interface {
|
2022-05-31 05:38:51 +00:00
|
|
|
Init(cfg *Config)
|
2022-05-29 06:26:36 +00:00
|
|
|
Name() string
|
2022-06-05 18:09:00 +00:00
|
|
|
EditableSlugs() bool
|
2022-06-18 06:17:08 +00:00
|
|
|
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
|
2022-06-15 07:33:56 +00:00
|
|
|
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-18 06:17:08 +00:00
|
|
|
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
|
|
|
}
|