bind

package
v0.0.0-...-0cf49f2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2015 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package bind provides interfaces and types for use when binding an app to a service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	// GetIp returns the app ip.
	GetIp() string

	// GetName returns the app name.
	GetName() string

	// GetUnits returns the app units.
	GetUnits() ([]Unit, error)

	// InstanceEnv returns the app enviroment variables.
	InstanceEnv(string) map[string]EnvVar

	// SetEnvs adds enviroment variables in the app.
	SetEnvs(setEnvs SetEnvApp, w io.Writer) error

	// UnsetEnvs removes the given enviroment variables from the app.
	UnsetEnvs(unsetEnvs UnsetEnvApp, w io.Writer) error

	// AddInstance adds an instance to the application.
	AddInstance(instanceApp InstanceApp, writer io.Writer) error

	// RemoveInstance removes an instance from the application.
	RemoveInstance(instanceApp InstanceApp, writer io.Writer) error
}

type EnvVar

type EnvVar struct {
	Name         string `json:"name"`
	Value        string `json:"value"`
	Public       bool   `json:"public"`
	InstanceName string `json:"-"`
}

EnvVar represents a environment variable for an app.

type InstanceApp

type InstanceApp struct {
	ServiceName   string
	Instance      ServiceInstance
	ShouldRestart bool
}

type ServiceInstance

type ServiceInstance struct {
	Name string            `json:"instance_name"`
	Envs map[string]string `json:"envs"`
}

type SetEnvApp

type SetEnvApp struct {
	Envs          []EnvVar
	PublicOnly    bool
	ShouldRestart bool
}

type Unit

type Unit interface {
	GetID() string
	GetIp() string
}

Unit represents an application unit to be used in binds.

type UnsetEnvApp

type UnsetEnvApp struct {
	VariableNames []string
	PublicOnly    bool
	ShouldRestart bool
}

Jump to

Keyboard shortcuts

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