Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCerts(keyFilePath, certFilePath, host string)
- func CreatePidFile(pidFile string)
- func DownloadDocker(url, dockerHome string)
- func DownloadNgrok(url, ngrokHome string)
- func GetCertificate(certFilePath string) (*string, error)
- func GetDockerClientVersion(dockerBinPath string) (version string)
- func HandleSig()
- func HttpGet(url string) ([]byte, error)
- func LoadDefaultConf()
- func NatTunnel(url, ngrokHome, ngrokLogPath, ngrokConfPath, uuid string)
- func ParseFlag()
- func RegPatch(url, caFilePath, certFilePath, configFilePath string) error
- func RegPost(url, caFilePath, configFilePath string) error
- func SaveConf(configFile string, conf Configuration) error
- func SendError(err error, msg string, extra map[string]interface{})
- func SendRequest(method, url string, data_bytes []byte, headers []string) ([]byte, error)
- func SetConfigFile(configFilePath string)
- func SetLogger(logFile string)
- func StartDocker(dockerBinPath, keyFilePath, certFilePath, caFilePath string)
- func StopDocker()
- func UpdateDocker(...)
- func VerifyRegistration(url string)
- type Configuration
- type ReachableForm
- type RegGetForm
- type RegPatchForm
- type RegPostForm
- type RegResponseForm
- type TargetDef
- type TunnelPatchForm
Constants ¶
View Source
const ( AgentHome = "/etc/dockercloud/agent/" DockerHome = "/usr/bin/" AgentLibHome = "/usr/lib/dockercloud/" LogDir = "/var/log/dockercloud/" DockerLogFileName = "docker.log" AgentLogFileName = "agent.log" KeyFileName = "key.pem" CertFileName = "cert.pem" CAFileName = "ca.pem" ConfigFileName = "dockercloud-agent.conf" DockerBinaryName = "docker" DockerTarName = "docker.tgz" DockerTarSigName = "docker.tgz.sig" NgrokBinaryName = "ngrok" NgrokLogName = "ngrok.log" NgrokConfName = "ngrok.conf" AgentPidFile = "/var/run/dockercloud-agent.pid" RegEndpoint = "api/agent/v1/node/" DockerDefaultHost = "unix:///var/run/docker.sock" MaxWaitingTime = 200 //seconds HeartBeatInterval = 5 //seconds RenicePriority = -10 ReniceSleepTime = 5 //seconds DockerHostPort = "2375" DialTimeOut = 10 //seconds )
View Source
const (
VERSION = "1.1.0"
)
Variables ¶
View Source
var ( FlagDebugMode *bool FlagLogToStdout *bool FlagStandalone *bool FlagSkipNatTunnel *bool FlagDockerHost *string FlagDockerOpts *string FlagHost *string FlagToken *string FlagUUID *string FlagNgrokHost *string FlagVersion *bool Conf Configuration Logger *log.Logger DockerProcess *os.Process ScheduleToTerminateDocker = false ScheduledShutdown = false DockerTarURL = "" NgrokTarURL = "" NgrokHost = "" )
View Source
var DSN string
Functions ¶
func CreateCerts ¶
func CreateCerts(keyFilePath, certFilePath, host string)
func CreatePidFile ¶
func CreatePidFile(pidFile string)
func DownloadDocker ¶
func DownloadDocker(url, dockerHome string)
func DownloadNgrok ¶
func DownloadNgrok(url, ngrokHome string)
func GetCertificate ¶
func GetDockerClientVersion ¶
func LoadDefaultConf ¶
func LoadDefaultConf()
func SaveConf ¶
func SaveConf(configFile string, conf Configuration) error
func SendRequest ¶
func SetConfigFile ¶
func SetConfigFile(configFilePath string)
func StartDocker ¶
func StartDocker(dockerBinPath, keyFilePath, certFilePath, caFilePath string)
func StopDocker ¶
func StopDocker()
func UpdateDocker ¶
func UpdateDocker(dockerHome, dockerTarPath, dockerTarSigPath, keyFilePath, certFilePath, caFilePath string)
func VerifyRegistration ¶
func VerifyRegistration(url string)
Types ¶
type Configuration ¶
type Configuration struct { CertCommonName string DockerHost string Host string Token string UUID string DockerOpts string }
func LoadConf ¶
func LoadConf(configFile string) (*Configuration, error)
type ReachableForm ¶
type ReachableForm struct {
Reachable bool `json:"reachable"`
}
type RegGetForm ¶
type RegGetForm struct { AgentVersion string `json:"agent_version"` DockerUrl string `json:"docker_url"` ExternalFqdn string `json:"external_fqdn"` NgrokUrl string `json:"ngrok_url"` PublicCert string `json:"public_cert"` ResourceUri string `json:"resource_uri"` State string `json:"state"` Tunnel string `json:"tunnel"` UserCaCert string `json:"user_ca_cert"` UUID string `json:"uuid"` NgrokHost string `json:"ngrok_server_addr"` }
type RegPatchForm ¶
type RegPostForm ¶
type RegPostForm struct {
AgentVersion string `json:"agent_version"`
}
type RegResponseForm ¶
type TunnelPatchForm ¶
Click to show internal directories.
Click to hide internal directories.