mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
33 lines
650 B
Go
33 lines
650 B
Go
package appearance
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/coder/coder/v2/codersdk"
|
|
)
|
|
|
|
type Fetcher interface {
|
|
Fetch(ctx context.Context) (codersdk.AppearanceConfig, error)
|
|
}
|
|
|
|
type AGPLFetcher struct {
|
|
docsURL string
|
|
}
|
|
|
|
func (f AGPLFetcher) Fetch(context.Context) (codersdk.AppearanceConfig, error) {
|
|
return codersdk.AppearanceConfig{
|
|
AnnouncementBanners: []codersdk.BannerConfig{},
|
|
SupportLinks: codersdk.DefaultSupportLinks(f.docsURL),
|
|
DocsURL: f.docsURL,
|
|
}, nil
|
|
}
|
|
|
|
func NewDefaultFetcher(docsURL string) Fetcher {
|
|
if docsURL == "" {
|
|
docsURL = codersdk.DefaultDocsURL()
|
|
}
|
|
return &AGPLFetcher{
|
|
docsURL: docsURL,
|
|
}
|
|
}
|