Documentation ¶
Overview ¶
Package library is a package which exposes the commands externally to the compiled binaries.
Index ¶
- Variables
- func Clean(c Config)
- func Down(c Config)
- func Export(c Config, output string)
- func GetServicesSorted(c *Config) []string
- func ImportDefaults(c *Config, service string, importer model.Service) bool
- func NetworkConnect(network string, containerName string) error
- func NetworkCreate(network types.NetworkResource) error
- func NetworkStatus(network string) (bool, error)
- func PrintStatusHumanReadable(c Config)
- func PrintStatusJSON(c Config)
- func Pull(c Config)
- func Restart(c Config)
- func Setup(c *Config)
- func SshKeyAdd(c Config, key string) error
- func Status(c Config)
- func Stop(c Config)
- func Up(c Config)
- func Update(c Config)
- func Version(c Config)
- type CompatibilityCheck
- type Config
- type Key
- type StatusJSON
- type StatusJSONStatus
Constants ¶
This section is empty.
Variables ¶
var PYGMY_VERSION = ""
PYGMY_VERSION is the equivalent to the version pygmy is being associated to. This variable is exclusively used when packaging a formal release.
Functions ¶
func Clean ¶
func Clean(c Config)
Clean will forcibly kill and remove all of pygmy's containers in the daemon
func Export ¶
Export will export validated configuration to a given path, or it will export by default to $HOME/.pygmy.yml
func GetServicesSorted ¶
GetServicesSorted will return a list of services as plain text. due to some weirdness the ssh agent must be the first value.
func ImportDefaults ¶
ImportDefaults is an exported function which allows third-party applications to provide their own *Service and integrate it with their application so that Pygmy is more extendable via API. It's here so that we have one common import functionality that respects the users' decision to import config defaults in a centralized way.
func NetworkConnect ¶
NetworkConnect is part of a centralised abstraction of the Docker API and will connect a created container to a docker network with a specified name.
func NetworkCreate ¶
func NetworkCreate(network types.NetworkResource) error
NetworkCreate is part of a centralised abstraction of the Docker API and will create a Docker network with a specified configuration.
func NetworkStatus ¶
NetworkStatus will check the state of a Docker network to test if it has been created, and will return false if the network can not be found.
func PrintStatusHumanReadable ¶ added in v0.12.0
func PrintStatusHumanReadable(c Config)
func PrintStatusJSON ¶ added in v0.12.0
func PrintStatusJSON(c Config)
func Pull ¶
func Pull(c Config)
Pull is an alias function for Update. It is here for the sake of user experience.
func Setup ¶
func Setup(c *Config)
Setup holds the core of configuration management with Pygmy. It will merge in all the configurations and provide defaults.
Types ¶
type CompatibilityCheck ¶
CompatibilityCheck is a struct of fields associated to reporting of a result state.
func DryRun ¶
func DryRun(c *Config) []CompatibilityCheck
DryRun will check for. It is here to check for port compatibility before Pygmy attempts to start any containers and provide the user with a report.
type Config ¶
type Config struct { // Keys are the paths to the Keys which should be added. Keys []Key `yaml:"keys"` // Domain is the default domain suffix to use. Domain string `yaml:"domain"` // Services is a []model.Service for an index of all Services. Services map[string]model.Service `yaml:"services"` SortedServices []string // Networks is for network configuration Networks map[string]types.NetworkResource `yaml:"networks"` // NoDefaults will prevent default configuration items. Defaults bool // JSONFormat indicates the `status` command should print to stdout in JSON format. JSONFormat bool // JSONStatus contains JSON status content. JSONStatus StatusJSON // Resolvers is for all resolvers Resolvers []resolv.Resolv `yaml:"resolvers"` // Volumes will ensure names volumes are created Volumes map[string]volume.Volume }
Config is a struct of configurable options which can be passed to package library to configure logic for continued abstraction.
type StatusJSON ¶ added in v0.12.0
type StatusJSON struct { PortAvailability []string `json:"port_availability"` Services map[string]StatusJSONStatus `json:"service_status"` Networks []string `json:"networks"` Resolvers []string `json:"resolvers"` Volumes []string `json:"volumes"` SSHMessages []string `json:"ssh_messages"` URLValidations []string `json:"url_validations"` }