From 1bc8eac481e6ad86ef61535d51bbfe0c0bb8dd99 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Sun, 5 Jun 2022 09:56:52 -0600 Subject: [PATCH] add build options to adapter interface --- archetype/adapter.go | 3 ++- archetype/eureka.go | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/archetype/adapter.go b/archetype/adapter.go index fb3171f..ad1f6fc 100644 --- a/archetype/adapter.go +++ b/archetype/adapter.go @@ -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) } diff --git a/archetype/eureka.go b/archetype/eureka.go index 133dd5b..51c16c2 100644 --- a/archetype/eureka.go +++ b/archetype/eureka.go @@ -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" }