Documentation
¶
Index ¶
- Variables
- func AddPortConfigToService(service *api.Service, name string, protocol api.Protocol, port int, ...)
- func BuildDeployment(name string, namespace string, maxUnavailable int, maxSurge int, replicas int, ...) *extensions.Deployment
- func BuildLoadBalancerService(name, namespace, selector string) *api.Service
- func BuildSlugRunnerDeployment(name string, namespace string, maxUnavailable int, maxSurge int, replicas int, ...) *extensions.Deployment
- func BuildSlugRunnerLBService(name, namespace, selector string) *api.Service
- func BuildSlugbuilderPod(env map[string]string, name, namespace, tarKey, putKey, buildpackURL string, ...) *api.Pod
- func IsAlreadyExistsError(err error) bool
- func IsInputError(err error) bool
- func IsNotFoundError(err error) bool
- func IsUnauthorizedError(err error) bool
- func NewAlreadyExistsError(a ...interface{}) error
- func NewAlreadyExistsErrorf(format string, a ...interface{}) error
- func NewAppBuilderError(a ...interface{}) error
- func NewAppBuilderErrorf(format string, a ...interface{}) error
- func NewInputError(a ...interface{}) error
- func NewInputErrorf(format string, a ...interface{}) error
- func NewNotFoundError(a ...interface{}) error
- func NewNotFoundErrorf(format string, a ...interface{}) error
- func NewUnauthorizedError(a ...interface{}) error
- func NewUnauthorizedErrorf(format string, a ...interface{}) error
- func SlugBuilderPodName(appName, shortSha string) string
- func WaitForPod(c *client.Client, ns, podName string, interval, timeout time.Duration) error
- func WaitForPodEnd(c *client.Client, ns, podName string, interval, timeout time.Duration) error
- type AppInterface
- type AppsInterface
- type DeploymentInterface
- type DeploymentsInterface
- type ErrorReason
- type HealthCheckProbe
- type NetworkInterface
- type NetworksInterface
- type TeamInterface
- type TeamsInterface
- type TeresaYaml
- type Token
- type UserInterface
- type UsersInterface
Constants ¶
This section is empty.
Variables ¶
var Client *k8sHelper
Client is used to keep only one connection with kubernetes
var K8sClient *unversioned.Client // FIXME: this is used just to keep back compatibility... whe should remove ASAP
K8sClient is used to keep back compatibility inside the Api
Functions ¶
func AddPortConfigToService ¶
func AddPortConfigToService( service *api.Service, name string, protocol api.Protocol, port int, targetPort int)
AddPortConfigToService add port to service
func BuildDeployment ¶
func BuildDeployment( name string, namespace string, maxUnavailable int, maxSurge int, replicas int, selector string, podSpec api.PodSpec) *extensions.Deployment
BuildDeployment builds and returns a deployment pointer.
func BuildLoadBalancerService ¶
BuildLoadBalancerService creates a service of type load balancer
func BuildSlugRunnerDeployment ¶
func BuildSlugRunnerDeployment( name string, namespace string, maxUnavailable int, maxSurge int, replicas int, selector string, slugURL string, env map[string]string) *extensions.Deployment
BuildSlugRunnerDeployment builds a deployment using a slugrunner image with the slug built by the slugbuilder some steps earlier.
func BuildSlugRunnerLBService ¶
BuildSlugRunnerLBService helps to create a slugrunner service pointing to port 5000
func BuildSlugbuilderPod ¶
func BuildSlugbuilderPod(env map[string]string, name, namespace, tarKey, putKey, buildpackURL string, debug bool) *api.Pod
BuildSlugbuilderPod is used to create an builder pod
func IsAlreadyExistsError ¶ added in v0.2.0
IsAlreadyExistsError checks if the error is of type "already exists"
func IsInputError ¶ added in v0.2.0
IsInputError checks if the error is of type "input"
func IsNotFoundError ¶ added in v0.2.0
IsNotFoundError checks if the error is of type "not found"
func IsUnauthorizedError ¶ added in v0.2.0
IsUnauthorizedError checks if the error is of type "unauthorized error"
func NewAlreadyExistsError ¶ added in v0.2.0
func NewAlreadyExistsError(a ...interface{}) error
NewAlreadyExistsError creates a new "already exists" error
func NewAlreadyExistsErrorf ¶ added in v0.2.0
NewAlreadyExistsErrorf formats a message according to a format specifier and returns the error
func NewAppBuilderError ¶ added in v0.2.0
func NewAppBuilderError(a ...interface{}) error
NewAppBuilderError creates a new "App Builder" error
func NewAppBuilderErrorf ¶ added in v0.2.0
NewAppBuilderErrorf formats a message according to a format specifier and returns the error
func NewInputError ¶ added in v0.2.0
func NewInputError(a ...interface{}) error
NewInputError creates a new "input" error
func NewInputErrorf ¶ added in v0.2.0
NewInputErrorf formats a message according to a format specifier and returns the error
func NewNotFoundError ¶ added in v0.2.0
func NewNotFoundError(a ...interface{}) error
NewNotFoundError creates a new "not found" error
func NewNotFoundErrorf ¶ added in v0.2.0
NewNotFoundErrorf formats a message according to a format specifier and returns the error
func NewUnauthorizedError ¶ added in v0.2.0
func NewUnauthorizedError(a ...interface{}) error
NewUnauthorizedError creates a new "unauthorized error" error
func NewUnauthorizedErrorf ¶ added in v0.2.0
NewUnauthorizedErrorf formats a message according to a format specifier and returns the error
func SlugBuilderPodName ¶
SlugBuilderPodName is used to generate a temp name to the builder pod
func WaitForPod ¶
WaitForPod waits for running stated, among others
Types ¶
type AppInterface ¶ added in v0.2.0
type AppInterface interface { Create(app *models.App, storage helpers.Storage, tk *Token) error Update(app *models.App, storage helpers.Storage, tk *Token) error UpdateEnvVars(appName string, operations []*models.PatchAppRequest, storage helpers.Storage, tk *Token) (app *models.App, err error) UpdateScale(appName string, scale int64, storage helpers.Storage, tk *Token) (app *models.App, err error) UpdateAutoScale(appName string, autoScale *models.AutoScale, storage helpers.Storage, tk *Token) (app *models.App, err error) Get(appName string, tk *Token) (app *models.App, err error) List(tk *Token) (app []*models.App, err error) GetLogs(appName string, tk *Token, opts *api.PodLogOptions) (io.ReadCloser, error) }
AppInterface is used to interact with Kubernetes and also to allow mock testing
type AppsInterface ¶ added in v0.2.0
type AppsInterface interface {
Apps() AppInterface
}
AppsInterface is used to allow mock testing
type DeploymentInterface ¶ added in v0.2.0
type DeploymentInterface interface { Get(appName string) (d *extensions.Deployment, err error) CreateWelcomeDeployment(app *models.App) error Create(appName, description string, file *runtime.File, storage helpers.Storage, tk *Token) (io.ReadCloser, error) Update(app *models.App, description string, storage helpers.Storage) error CreateAutoScale(app *models.App) error UpdateAutoScale(app *models.App) error }
DeploymentInterface is used to interact with Kubernetes and also to allow mock testing
type DeploymentsInterface ¶ added in v0.2.0
type DeploymentsInterface interface {
Deployments() DeploymentInterface
}
DeploymentsInterface is used to allow mock testing
type ErrorReason ¶ added in v0.2.0
type ErrorReason string
ErrorReason used to check error types
const ( InputError ErrorReason = "InputError" AlreadyExists ErrorReason = "AlreadyExists" NotFound ErrorReason = "NotFound" AppBuilderError ErrorReason = "AppBuilderError" )
Error Reasons const used to check error types
type HealthCheckProbe ¶ added in v0.2.0
type NetworkInterface ¶ added in v0.2.0
type NetworkInterface interface { CreateService(app *models.App) error GetService(appName string) (srv *api.Service, err error) }
NetworkInterface is used to interact with Kubernetes and also to allow mock testing
type NetworksInterface ¶ added in v0.2.0
type NetworksInterface interface {
Networks() DeploymentInterface
}
NetworksInterface is used to allow mock testing
type TeamInterface ¶ added in v0.2.0
TeamInterface is used to interact with Kubernetes and also to allow mock testing
type TeamsInterface ¶ added in v0.2.0
type TeamsInterface interface {
Teams() TeamInterface
}
TeamsInterface is used to allow mock testing
type TeresaYaml ¶ added in v0.2.0
type TeresaYaml struct { HealthCheck *struct { Liveness *HealthCheckProbe Readiness *HealthCheckProbe } `yaml:"healthCheck,omitempty"` RollingUpdate *struct { MaxSurge *string `yaml:"maxSurge,omitempty"` MaxUnavailable *string `yaml:"maxUnavailable,omitempty"` } `yaml:"rollingUpdate,omitempty"` }
type Token ¶ added in v0.2.0
Token is a web token with all the user info
func IToToken ¶ added in v0.2.0
func IToToken(i interface{}) *Token
IToToken executes a type assertion from the interface to a Token
func (*Token) IsAuthorized ¶ added in v0.2.0
IsAuthorized checks if the user (from token) is authorized to do something with the team passed as param
type UserInterface ¶ added in v0.2.0
type UserInterface interface { GetWithTeams(userEmail string, tk *Token, l *log.Entry) (user *models.User, err error) LoadUserToToken(tk *Token, l *log.Entry) error }
UserInterface is used to interact with Kubernetes and also to allow mock testing
type UsersInterface ¶ added in v0.2.0
type UsersInterface interface {
Users() UserInterface
}
UsersInterface is used to allow mock testing