Documentation ¶
Index ¶
- type Command
- type CommandDir
- type Config
- type LayerParams
- type Route
- func (r *Route) HandlesCommand() bool
- func (r *Route) HandlesStatic() bool
- func (r *Route) HandlesTemplate() bool
- func (r *Route) IsCommandDirRoute() bool
- func (r *Route) IsCommandRoute() bool
- func (r *Route) IsStaticFileRoute() bool
- func (r *Route) IsStaticRoute() bool
- func (r *Route) IsTemplateDirRoute() bool
- func (r *Route) IsTemplateRoute() bool
- type RouteHandlerConfiguration
- type Static
- type StaticFile
- type Template
- type TemplateDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { File string `yaml:"file"` TemplateName string `yaml:"templateName"` AdditionalData map[string]string `yaml:"additionalData,omitempty"` Defaults *LayerParams `yaml:"defaults,omitempty"` Overrides *LayerParams `yaml:"overrides,omitempty"` }
func (*Command) ExpandPaths ¶
type CommandDir ¶
type CommandDir struct { Repositories []string `yaml:"repositories"` IncludeDefaultRepositories bool `yaml:"includeDefaultRepositories"` TemplateDirectory string `yaml:"templateDirectory,omitempty"` TemplateName string `yaml:"templateName,omitempty"` IndexTemplateName string `yaml:"indexTemplateName,omitempty"` AdditionalData map[string]string `yaml:"additionalData,omitempty"` Defaults *LayerParams `yaml:"defaults,omitempty"` Overrides *LayerParams `yaml:"overrides,omitempty"` }
func (*CommandDir) ExpandPaths ¶
func (c *CommandDir) ExpandPaths() error
type LayerParams ¶
type LayerParams struct { Layers map[string]map[string]interface{} `yaml:"layers,omitempty"` Flags map[string]interface{} `yaml:"flags,omitempty"` Arguments map[string]interface{} `yaml:"arguments,omitempty"` }
func NewLayerParams ¶
func NewLayerParams() *LayerParams
func (*LayerParams) Merge ¶
func (p *LayerParams) Merge(overrides *LayerParams)
Merge merges the two LayerParams, with the overrides taking precedence. It merges all the layers, flags, and arguments. For each layer, the layer flags are merged as well, overrides taking precedence.
type Route ¶
type Route struct { Path string `yaml:"path"` CommandDirectory *CommandDir `yaml:"commandDirectory,omitempty"` Command *Command `yaml:"command,omitempty"` Static *Static `yaml:"static,omitempty"` StaticFile *StaticFile `yaml:"staticFile,omitempty"` TemplateDirectory *TemplateDir `yaml:"templateDirectory,omitempty"` Template *Template `yaml:"template,omitempty"` DefaultStaticDirectory bool `yaml:"defaultStaticDirectory,omitempty"` DefaultTemplateDirectory bool `yaml:"defaultTemplateDirectory,omitempty"` }
Route represents a single sub-route of the server. Only one of the booleans or one of the pointers should be true or non-nil. This is the first attempt at the structure of a config file, and is bound to change.
func (*Route) HandlesCommand ¶
func (*Route) HandlesStatic ¶
func (*Route) HandlesTemplate ¶
func (*Route) IsCommandDirRoute ¶
func (*Route) IsCommandRoute ¶
func (*Route) IsStaticFileRoute ¶
func (*Route) IsStaticRoute ¶
func (*Route) IsTemplateDirRoute ¶
func (*Route) IsTemplateRoute ¶
type RouteHandlerConfiguration ¶
type RouteHandlerConfiguration interface { // ExpandPaths() error }
RouteHandlerConfiguration is the interface that all route handler configurations must implement. By RouteHandlerConfiguration, we mean things like CommandDir, Command, Static, etc...
type Static ¶
type Static struct {
LocalPath string `yaml:"localPath"`
}
func (*Static) ExpandPaths ¶
type StaticFile ¶
type StaticFile struct {
LocalPath string `yaml:"localPath"`
}
func (*StaticFile) ExpandPaths ¶
func (s *StaticFile) ExpandPaths() error
type Template ¶
type Template struct { // every request will be rendered from the template file TemplateFile string `yaml:"templateFile"` }
func (*Template) ExpandPaths ¶
type TemplateDir ¶
type TemplateDir struct { LocalDirectory string `yaml:"localDirectory"` IndexTemplateName string `yaml:"indexTemplateName,omitempty"` AdditionalData map[string]interface{} `yaml:"additionalData,omitempty"` }
func (*TemplateDir) ExpandPaths ¶
func (t *TemplateDir) ExpandPaths() error
Click to show internal directories.
Click to hide internal directories.