Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppDockerImage ¶
type AppDockerImage struct {
Image string `json:"image,omitempty"`
}
AppDockerImage is the struct for docker configuration.
type Application ¶
type Application struct { Name string `json:"name,omitempty"` Path string `json:"path,omitempty"` LegacyBuildpack string `json:"buildpack,omitempty"` Buildpacks []string `json:"buildpacks,omitempty"` Stack string `json:"stack,omitempty"` Docker AppDockerImage `json:"docker,omitempty"` Env map[string]string `json:"env,omitempty"` Services []string `json:"services,omitempty"` DiskQuota string `json:"disk_quota,omitempty"` Memory string `json:"memory,omitempty"` CPU string `json:"cpu,omitempty"` Instances *int `json:"instances,omitempty"` // TODO(#95): These aren't CF proper. How do we expose these in the // manifest? MinScale *int `json:"min-scale,omitempty"` MaxScale *int `json:"max-scale,omitempty"` Routes []Route `json:"routes,omitempty"` NoRoute *bool `json:"no-route,omitempty"` RandomRoute *bool `json:"random-route,omitempty"` // HealthCheckTimeout holds the health check timeout. // Note the serialized field is just timeout. HealthCheckTimeout int `json:"timeout,omitempty"` // HealthCheckType holds the type of health check that will be performed to // determine if the app is alive. Either port or http, blank means port. HealthCheckType string `json:"health-check-type,omitempty"` // HealthCheckHTTPEndpoint holds the HTTP endpoint that will receive the // get requests to determine liveness if HealthCheckType is http. HealthCheckHTTPEndpoint string `json:"health-check-http-endpoint,omitempty"` }
Application is a configuration for a single 12-factor-app.
func (*Application) Buildpack ¶
func (app *Application) Buildpack() string
Buildpack joins together the buildpacks in order as a CSV to be compatible with buildpacks v3. If no buildpacks are specified, the legacy buildpack field is checked.
Example ¶
package main import ( "fmt" "github.com/poy/kf/pkg/kf/manifest" ) func main() { app := manifest.Application{} app.LegacyBuildpack = "hidden-legacy-buildpack" fmt.Println("Legacy:", app.Buildpack()) app.Buildpacks = []string{"java"} fmt.Println("One:", app.Buildpack()) app.Buildpacks = []string{"maven", "java"} fmt.Println("Two:", app.Buildpack()) }
Output: Legacy: hidden-legacy-buildpack One: java Two: maven,java
func (*Application) Override ¶
func (app *Application) Override(overrides *Application) error
Override overrides values using corresponding non-empty values from overrides. Environment variables are extended with override taking priority.
type Manifest ¶
type Manifest struct {
Applications []Application `json:"applications"`
}
Manifest is an application's configuration.
func CheckForManifest ¶
CheckForManifest will optionally return a Manifest given a directory.
func NewFromFile ¶
NewFromFile creates a Manifest from a manifest file.
func NewFromReader ¶
NewFromReader creates a Manifest from a reader.