Documentation
¶
Overview ¶
Package app implements functionality related to reading and writing app configuration files.
Index ¶
- Constants
- func NameFromContext(ctx context.Context) string
- func WithConfig(ctx context.Context, cfg *Config) context.Context
- func WithName(ctx context.Context, name string) context.Context
- type Build
- type Config
- func (c *Config) DockerBuildTarget() string
- func (c *Config) Dockerfile() string
- func (c *Config) EncodeTo(w io.Writer) error
- func (ac *Config) HasBuilder() bool
- func (ac *Config) HasBuiltin() bool
- func (c *Config) HasDefinition() bool
- func (c *Config) HasServices() bool
- func (ac *Config) Image() string
- func (c *Config) InternalPort() (int, error)
- func (c *Config) SetDockerCommand(cmd string)
- func (c *Config) SetDockerEntrypoint(entrypoint string)
- func (c *Config) SetEnvVariable(name, value string)
- func (c *Config) SetEnvVariables(vals map[string]string)
- func (c *Config) SetInternalPort(port int) bool
- func (c *Config) SetKillSignal(signal string)
- func (c *Config) SetProcess(name, value string)
- func (c *Config) SetReleaseCommand(cmd string)
- func (c *Config) SetStatics(statics []sourcecode.Static)
- func (c *Config) SetVolumes(volumes []sourcecode.Volume)
- func (c *Config) WriteToFile(filename string) (err error)
Constants ¶
View Source
const DefaultConfigFileName = "fly.toml"
DefaultConfigFileName denotes the default application configuration file name.
Variables ¶
This section is empty.
Functions ¶
func NameFromContext ¶
func NameFromContext(ctx context.Context) string
NameFromContext returns the app name ctx carries or an empty string.
func WithConfig ¶
func WithConfig(ctx context.Context, cfg *Config) context.Context
WithConfig derives a context that carries cfg from ctx.
Types ¶
type Build ¶
type Build struct {
Builder string
Args map[string]string
Buildpacks []string
// Or...
Builtin string
Settings map[string]interface{}
// Or...
Image string
// Or...
Dockerfile string
DockerBuildTarget string
}
type Config ¶
type Config struct {
AppName string
Build *Build
Definition map[string]interface{}
Path string
}
Config wraps the properties of app configuration.
func ConfigFromContext ¶
func ConfigFromContext(ctx context.Context) *Config
ConfigFromContext returns the Config ctx carries.
func LoadConfig ¶
func LoadConfig(path string) (cfg *Config, err error)
LoadConfig loads the app config at the given path.
func (*Config) DockerBuildTarget ¶
func (c *Config) DockerBuildTarget() string
func (*Config) Dockerfile ¶
func (c *Config) Dockerfile() string
func (*Config) HasBuilder ¶
func (ac *Config) HasBuilder() bool
func (*Config) HasBuiltin ¶
func (ac *Config) HasBuiltin() bool
func (*Config) HasDefinition ¶
func (c *Config) HasDefinition() bool
func (*Config) HasServices ¶
func (c *Config) HasServices() bool
HasServices - Does this config have a services section
func (*Config) InternalPort ¶
func (c *Config) InternalPort() (int, error)
func (*Config) SetDockerCommand ¶
func (c *Config) SetDockerCommand(cmd string)
func (*Config) SetDockerEntrypoint ¶
func (c *Config) SetDockerEntrypoint(entrypoint string)
func (*Config) SetEnvVariable ¶
func (c *Config) SetEnvVariable(name, value string)
func (*Config) SetEnvVariables ¶
func (c *Config) SetEnvVariables(vals map[string]string)
func (*Config) SetInternalPort ¶
func (c *Config) SetInternalPort(port int) bool
func (*Config) SetKillSignal ¶
func (c *Config) SetKillSignal(signal string)
func (*Config) SetProcess ¶
func (c *Config) SetProcess(name, value string)
func (*Config) SetReleaseCommand ¶
func (c *Config) SetReleaseCommand(cmd string)
func (*Config) SetStatics ¶
func (c *Config) SetStatics(statics []sourcecode.Static)
func (*Config) SetVolumes ¶
func (c *Config) SetVolumes(volumes []sourcecode.Volume)
func (*Config) WriteToFile ¶
func (c *Config) WriteToFile(filename string) (err error)
Click to show internal directories.
Click to hide internal directories.