Skip to content

Commit

Permalink
Teach the manifest about dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsch committed Sep 7, 2021
1 parent 038005e commit 6936881
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/commands/compute/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ type Mapper map[string]interface{}
// LocalServer represents a list of backends that should be mocked as per the
// configuration values.
type LocalServer struct {
Backends map[string]Backend `toml:"backends"`
Backends map[string]Backend `toml:"backends"`
Dictionaries map[string]Dictionary `toml:"dictionaries,omitempty"`
}

// Backend represents a backend to be mocked by the local testing server.
Expand All @@ -225,6 +226,12 @@ type Backend struct {
OverrideHost string `toml:"override_host,omitempty"`
}

// Dictionary represents a dictionary to be mocked by the local testing server.
type Dictionary struct {
File string `toml:"file"`
Format string `toml:"format"`
}

// Exists yields whether the manifest exists.
func (f *File) Exists() bool {
return f.exists
Expand Down
6 changes: 6 additions & 0 deletions pkg/commands/compute/testdata/init/fastly-viceroy-update.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ name = "Default Rust template"

[local_server.backends.bar]
url = "https://bar.com/"

[local_server.dictionaries]

[local_server.dictionaries.strings]
file = "strings.json"
format = "json"

0 comments on commit 6936881

Please sign in to comment.