add build options to adapter interface

This commit is contained in:
Iris Lightshard 2022-06-05 09:56:52 -06:00
parent 59c7fbcc74
commit 1bc8eac481
Signed by: nilix
GPG key ID: 3B7FBC22144E6398
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,7 @@ type Adapter interface {
Init(cfg *Config)
Name() string
EditableSlugs() bool
BuildOptions() ([]string)
GetConfig(key string) (interface{}, error)
SetConfig(key string, value interface{}) error
ListPages() map[string]string
@ -13,5 +14,5 @@ type Adapter interface {
CreatePage(slug, title, content string) error
SavePage(oldSlug, newSlug, title, content string) error
DeletePage(slug string) error
Build() (bool, string)
Build(buildOptions map[string]string) (bool, string)
}

View file

@ -31,6 +31,10 @@ func (self *EurekaAdapter) EditableSlugs() bool {
return false
}
func (self *EurekaAdapter) BuildOptions() []string {
return []string{"twtxt"}
}
func (self *EurekaAdapter) GetConfig(key string) (interface{}, error) {
return nil, nil
}
@ -103,6 +107,6 @@ func (self *EurekaAdapter) DeletePage(slug string) error {
return nil
}
func (self *EurekaAdapter) Build() (bool, string) {
func (self *EurekaAdapter) Build(buildOptions map[string]string) (bool, string) {
return true, "Build successful"
}