Package mktmpio provides easy access to the database servier provisioning services at https://mktmp.io/
const ( Copyright = "Copyright Datajin Technologies, Inc. 2015,2016. All rights reserved." LicenseName = "Artistic-2.0" LicenseURL = "http://opensource.org/licenses/Artistic-2.0" )
exposed for package introspection and
const MKtmpioCfgFile = "~/.mktmpio.yml"
MKtmpioCfgFile is the path to the user's config
const MktmpioURL = "https://mktmp.io/api/v1"
MktmpioURL is the root of the current version of the mktmpio HTTP API
ConfigPath returns the path to the user config file
Client provides authenticated API access for creating, listing, and destroying database servers.
NewClient creates a mktmpio Client using credentials loaded from the user config stored in ~/.mktmpio.yml
Attach creates a remote shell for the instance identified by `id` and then returns a Reader and a Writer for communicating with it via a pseudo-TTY. The bytes read from the channel will include TTY control sequences. This type of connection is most appropriate for connecting directly to a local TTY.
AttachStdio creates a remote shell for the instance identified by `id` and returns an io.WriteCloser for that shell's stdin and an io.Reader for each of stdout and stderr on that shell. This is for non-interactive shells, like one would use for piping a script into a shell or for piping the output from.
Create creates a server of the type specified by `service`.
Destroy shuts down and deletes the server identified by `id`.
List generates retrieves a list of curently running instances
SetLogger sets the logger to be used for verbose logging of errors
Config contains the user config options used for accessing the mktmpio API.
DefaultConfig returns a configuration with only the default values set
EnvConfig returns a configuration with only values provided by environment variables
FileConfig returns a configuration with any values provided by the given YAML config file
LoadConfig loads the configuration stored in `~/.mktmpio.yml`, returning it as a Config type instance.
Apply creates a new Config with non-empty values from the provided Config overriding the options of the base Config
Save stores the given configuration in ~/.mktmpio.yml, overwriting the current contents if the file exists.
Instance represents a server that has been created on the mktmpio service.
Cmd returns an exec.Cmd that is pre-populated with the command, arguments, and environment variables required for spawning a local shell connected to the remote server.
Destroy the server on the mktmpio service
LoadEnv modifies the current environment by setting environment variables that contain the host, port and credentials required for connecting to the remote server represented by the Instance.