Documentation
¶
Overview ¶
Package application provides utility functions for interacting with Deploio applications.
Index ¶
- Constants
- func ApplyProbePatch(cfg *apps.Config, pp ProbePatch)
- func EnvVarByName(envVars apps.EnvVars, name string) *apps.EnvVar
- func EnvVarsFromMap(env map[string]string, options ...EnvVarModifier) apps.EnvVars
- func LatestAvailableRelease(releases *apps.ReleaseList) *apps.Release
- func OrderReleaseList(releaseList *apps.ReleaseList, reverse bool)
- func Releases(ctx context.Context, client *api.Client, app types.NamespacedName) (*apps.ReleaseList, error)
- func StaticEgresses(ctx context.Context, client *api.Client, app types.NamespacedName) ([]networking.StaticEgress, error)
- func UnverifiedHosts(app *apps.Application) []string
- func UpdateEnvVars(oldEnvs []apps.EnvVar, newEnvs, sensitiveEnvs map[string]string, ...) apps.EnvVars
- func ValidateConfig(config apps.Config) error
- func ValidatePEM(content string) (*string, error)
- type BasicAuth
- type DNSDetail
- type EnvVarModifier
- type OptInt32
- type OptString
- type Patcher
- type ProbePatch
- type RepositoryValidator
- type SetState
Constants ¶
const ( // BasicAuth key constants which represent the keys used in basic auth // secrets BasicAuthUsernameKey = "basicAuthUsername" BasicAuthPasswordKey = "basicAuthPassword" )
const (
ApplicationNameLabel = "application.apps.nine.ch/name"
)
const ( // DNSSetupURL redirects to the proper deplo.io docs entry about // how to setup custom hosts DNSSetupURL = "https://docs.nine.ch/a/myshbw3EY1" )
Variables ¶
This section is empty.
Functions ¶
func ApplyProbePatch ¶
func ApplyProbePatch(cfg *apps.Config, pp ProbePatch)
ApplyProbePatch mutates cfg.
func EnvVarsFromMap ¶
func EnvVarsFromMap(env map[string]string, options ...EnvVarModifier) apps.EnvVars
func LatestAvailableRelease ¶
func LatestAvailableRelease(releases *apps.ReleaseList) *apps.Release
func OrderReleaseList ¶
func OrderReleaseList(releaseList *apps.ReleaseList, reverse bool)
OrderReleaseList orders the given list of releases first by name and then by creation timestamp latest to oldest. Reverse reverses the order by creation timestamp to oldest to latest.
func Releases ¶
func Releases(ctx context.Context, client *api.Client, app types.NamespacedName) (*apps.ReleaseList, error)
Releases returns a release list of an app. If the returned error is nil, the release list is guaranteed to have at least one item.
func StaticEgresses ¶
func StaticEgresses(ctx context.Context, client *api.Client, app types.NamespacedName) ([]networking.StaticEgress, error)
StaticEgresses returns all static egress resources targeting the specified app.
func UnverifiedHosts ¶
func UnverifiedHosts(app *apps.Application) []string
func UpdateEnvVars ¶
func ValidateConfig ¶
ValidateConfig validates the configuration of an application.
func ValidatePEM ¶
ValidatePEM validates if the passed content is in valid PEM format, errors out if the content is empty
Types ¶
type BasicAuth ¶
type BasicAuth struct {
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
}
BasicAuth contains credentials for basic authentication
type DNSDetail ¶
type DNSDetail struct {
Application string `json:"application"`
Project string `json:"project"`
TXTRecord string `json:"txtRecord"`
CNAMETarget string `json:"cnameTarget"`
}
func DNSDetails ¶
func DNSDetails(items []apps.Application) []DNSDetail
DNSDetails retrieves the DNS details of all given applications
type EnvVarModifier ¶
func Sensitive ¶
func Sensitive() EnvVarModifier
type OptInt32 ¶
OptInt32 is an "Optional int32 field" wrapper. It works the same way as OptString, but for numeric fields. Again, this lets us distinguish Unset (no flag) vs Set (positive value) vs Clear (explicitly reset to nil/default).
type OptString ¶
OptString is an "Optional string field" wrapper. It carries both a string value and a state (Unset / Set / Clear).
type Patcher ¶
type Patcher interface {
ToProbePatch() ProbePatch
}
Patcher is implemented by command-specific flag structs to produce a ProbePatch.
type ProbePatch ¶
ProbePatch is the normalized type used by both create and update paths.