Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage holds example values synthesized from a package's OpenAPI settings and values schemas. Both maps are produced once at construction by defaults.Generate; the accessors are pure getters that return the cached instances.
Either map may be nil if the corresponding schema file was missing. The returned maps are shared references — callers must not mutate them.
func LoadStorage ¶
LoadStorage loads the OpenAPI schemas from path/openapi (settings.yaml or the legacy config-values.yaml, plus values.yaml), compiles them, and synthesizes an example map from each. The synthesized maps are served unchanged by GetSettings and GetValues.
Missing schema files are tolerated: the corresponding example map will be nil.
Returns an error if a schema file is unreadable, schema compilation fails, or example synthesis fails.
func (*Storage) GetSettings ¶
GetSettings returns the example settings synthesized from the settings schema, or nil if no settings schema was present. The returned map is the cached instance — do not mutate.
Directories
¶
| Path | Synopsis |
|---|---|
|
defaults
Package defaults synthesizes an example value map from an OpenAPI schema.
|
Package defaults synthesizes an example value map from an OpenAPI schema. |
|
reggen
Package reggen produces example strings that match a Perl-flavored regular expression.
|
Package reggen produces example strings that match a Perl-flavored regular expression. |