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) DeterminePlatform(ctx context.Context, r io.ReadSeeker) (err error)
- func (c *Config) DockerBuildTarget() string
- func (c *Config) Dockerfile() string
- func (c *Config) EncodeTo(w io.Writer) error
- func (c *Config) ForMachines() bool
- func (c *Config) GetEnvVariables() map[string]string
- func (c *Config) GetPrimaryRegion() string
- 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) SetMachinesPlatform()
- func (c *Config) SetNomadPlatform()
- func (c *Config) SetPlatformVersion(platform string)
- func (c *Config) SetPrimaryRegion(regionCode string)
- func (c *Config) SetProcess(name, value string)
- func (c *Config) SetReleaseCommand(cmd string)
- func (c *Config) SetStatics(statics []scanner.Static)
- func (c *Config) SetVolumes(volumes []scanner.Volume)
- func (c *Config) Validate() (err error)
- func (c *Config) WriteToDisk() (err error)
- func (c *Config) WriteToFile(filename string) (err error)
- type HttpService
- type SlimConfig
- type VM
Constants ¶
const ( // DefaultConfigFileName denotes the default application configuration file name. DefaultConfigFileName = "fly.toml" // Config is versioned, initially, to separate nomad from machine apps without having to consult // the API NomadPlatform = "nomad" MachinesPlatform = "machines" )
Variables ¶
This section is empty.
Functions ¶
func NameFromContext ¶
NameFromContext returns the app name ctx carries or an empty string.
func WithConfig ¶
WithConfig derives a context that carries cfg from ctx.
Types ¶
type Config ¶
type Config struct { AppName string `toml:"app,omitempty"` Build *Build `toml:"build,omitempty"` HttpService *HttpService `toml:"http_service,omitempty"` VM *VM `toml:"vm,omitempty"` Definition map[string]interface{} `toml:"definition,omitempty"` Path string `toml:"path,omitempty"` Services []api.MachineService `toml:"services"` Env map[string]string `toml:"env" json:"env"` Metrics *api.MachineMetrics `toml:"metrics" json:"metrics"` // contains filtered or unexported fields }
Config wraps the properties of app configuration.
func ConfigFromContext ¶
ConfigFromContext returns the Config ctx carries.
func LoadConfig ¶
LoadConfig loads the app config at the given path.
func (*Config) DeterminePlatform ¶ added in v0.0.343
func (*Config) DockerBuildTarget ¶
func (*Config) Dockerfile ¶
func (*Config) ForMachines ¶ added in v0.0.343
ForMachines is true when the config is intended for the machines platform
func (*Config) GetEnvVariables ¶ added in v0.0.335
func (*Config) GetPrimaryRegion ¶ added in v0.0.343
SetPrimaryRegion gets the region to be used for deployment. primaryRegion is private to avoid being marshalled to TOML.
func (*Config) HasBuilder ¶
func (*Config) HasBuiltin ¶
func (*Config) HasDefinition ¶
func (*Config) HasServices ¶
HasServices - Does this config have a services section
func (*Config) InternalPort ¶
func (*Config) SetDockerCommand ¶
func (*Config) SetDockerEntrypoint ¶
func (*Config) SetEnvVariable ¶
func (*Config) SetEnvVariables ¶
func (*Config) SetInternalPort ¶
func (*Config) SetKillSignal ¶
func (*Config) SetMachinesPlatform ¶ added in v0.0.343
func (c *Config) SetMachinesPlatform()
SetMachinesPlatform informs the TOML marshaller that this config is for the machines platform
func (*Config) SetNomadPlatform ¶ added in v0.0.343
func (c *Config) SetNomadPlatform()
SetNomadPlatform informs the TOML marshaller that this config is for the nomad platform
func (*Config) SetPlatformVersion ¶ added in v0.0.344
func (*Config) SetPrimaryRegion ¶ added in v0.0.343
SetPrimaryRegion sets the region to be used for deployment. primaryRegion is private to avoid being marshalled to TOML.
func (*Config) SetProcess ¶
func (*Config) SetReleaseCommand ¶
func (*Config) SetStatics ¶
func (*Config) SetVolumes ¶
func (*Config) WriteToDisk ¶ added in v0.0.335
func (*Config) WriteToFile ¶
type HttpService ¶ added in v0.0.337
type HttpService struct { InternalPort int `json:"internal_port" toml:"internal_port" validate:"required,numeric"` ForceHttps bool `toml:"force_https"` Concurrency api.MachineServiceConcurrency `toml:"concurrency"` }
type SlimConfig ¶ added in v0.0.342
type SlimConfig struct {
AppName string `toml:"app,omitempty"`
}
Use this type to unmarshal fly.toml with the goal of retreiving the app name only