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 `yaml:"image,omitempty"`
}
AppDockerImage is the struct for docker configuration.
type Application ¶
type Application struct {
Name string `yaml:"name,omitempty"`
Path string `yaml:"path,omitempty"`
Buildpacks []string `yaml:"buildpacks,omitempty"`
Docker AppDockerImage `yaml:"docker,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
Services []string `yaml:"services,omitempty"`
DiskQuota string `yaml:"disk_quota,omitempty"`
Memory string `yaml:"memory,omitempty"`
CPU string `yaml:"cpu,omitempty"`
Instances *int `yaml:"instances,omitempty"`
// TODO(#95): These aren't CF proper. How do we expose these in the
// manifest?
MinScale *int `yaml:"min-scale,omitempty"`
MaxScale *int `yaml:"max-scale,omitempty"`
Routes []Route `yaml:"routes,omitempty"`
NoRoute *bool `yaml:"no-route,omitempty"`
RandomRoute *bool `yaml:"random-route,omitempty"`
// HealthCheckTimeout holds the health check timeout.
// Note the serialized field is just timeout.
HealthCheckTimeout int `yaml:"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 `yaml:"health-check-type,omitempty"`
// HealthCheckHTTPEndpoint holds the HTTP endpoint that will receive the
// get requests to determine liveness if HealthCheckType is http.
HealthCheckHTTPEndpoint string `yaml:"health-check-http-endpoint,omitempty"`
}
Application is a configuration for a single 12-factor-app.
func (*Application) Buildpack ¶
func (app *Application) Buildpack() string
Buildpack joings toegether the buildpacks in order as a CSV to be compatible with buildpacks v3.
Example ¶
package main
import (
"fmt"
"github.com/google/kf/pkg/kf/manifest"
)
func main() {
app := manifest.Application{}
app.Buildpacks = []string{"java"}
fmt.Println("One:", app.Buildpack())
app.Buildpacks = []string{"maven", "java"}
fmt.Println("Two:", app.Buildpack())
}
Output: 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 `yaml:"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.
Click to show internal directories.
Click to hide internal directories.