app

package
v0.0.286-pre-3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package app implements functionality related to reading and writing app configuration files.

Index

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.

func WithName

func WithName(ctx context.Context, name string) context.Context

WithName derives a context that carries the given app name 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) EncodeTo

func (c *Config) EncodeTo(w io.Writer) error

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) Image

func (ac *Config) Image() string

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL