Documentation ¶
Index ¶
- Constants
- func CheckClose(c io.Closer, err *error)
- func DefaultInt64(v int64, defaultVal int64) int64
- func EnvVarMap() map[string]string
- func ExecInContainer(dockerClient *docker.Client, containerId string, cmd []string) error
- func GetOutboundIP() (net.IP, error)
- func GlobMatches(globOrStr string, target string) bool
- func ImageExistsLocally(dockerClient *docker.Client, imageName string) (bool, error)
- func InterpolateWithMap(input string, vars map[string]string) string
- func IsErrRemovalInProgress(err error) bool
- func ListMaelstromContainers(dockerClient *docker.Client) ([]types.Container, error)
- func MakeSSHKeyPair(pubKeyPath, privateKeyPath string, keySize int) error
- func MaxInt64(vals ...int64) int64
- func MillisToTime(millis int64) time.Time
- func NewHTTPClientWithSettings(httpSettings HTTPClientSettings) (*http.Client, error)
- func NormalizeImageName(name string) string
- func NowMillis() int64
- func ParseEnvVarMap(nvpairs []string) map[string]string
- func PullImage(dockerClient *docker.Client, c v1.Component) error
- func RemoveContainer(dockerClient *docker.Client, containerId string, componentName string, ...) error
- func RemoveMaelstromContainers(dockerClient *docker.Client, reason string) (int, error)
- func ResolveMaelstromHost(dockerClient *docker.Client) (string, error)
- func ScanCRLF(data []byte, atEOF bool) (advance int, token []byte, err error)
- func SortedMapKeys(m map[string]string) []string
- func StartContainer(dockerClient *docker.Client, c *v1.Component, maelstromUrl string) (string, error)
- func StrTruncate(s string, maxlen int) string
- func TimeToMillis(t time.Time) int64
- func ToIntOrDefault(s string, defaultVal int) int
- func TruncContainerId(id string) string
- func TruncNodeId(id string) string
- type ContainerExitedMessage
- type DockerEvent
- type DockerImageMonitor
- type DockerImageObserver
- type HTTPClientSettings
- type ImageUpdatedMessage
- type LogMsg
- type StringPtr
Constants ¶
View Source
const PingLogMsg = "PING"
Variables ¶
This section is empty.
Functions ¶
func CheckClose ¶
func DefaultInt64 ¶
func ExecInContainer ¶
func GetOutboundIP ¶
Get preferred outbound IP of this machine From: https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go
func GlobMatches ¶
func ImageExistsLocally ¶
func IsErrRemovalInProgress ¶
func ListMaelstromContainers ¶
func MakeSSHKeyPair ¶
MakeSSHKeyPair make a pair of public and private keys for SSH access. Public key is encoded in the format for inclusion in an OpenSSH authorized_keys file. Private Key generated is PEM encoded keySize is the size of the private key in bytes
func MillisToTime ¶
func NewHTTPClientWithSettings ¶
func NewHTTPClientWithSettings(httpSettings HTTPClientSettings) (*http.Client, error)
func NormalizeImageName ¶
func ParseEnvVarMap ¶
func RemoveContainer ¶
func ScanCRLF ¶
From: https://stackoverflow.com/questions/37530451/golang-bufio-read-multiline-until-crlf-r-n-delimiter
func SortedMapKeys ¶
func StartContainer ¶
func StrTruncate ¶
func TimeToMillis ¶
func ToIntOrDefault ¶
func TruncContainerId ¶
func TruncNodeId ¶
Types ¶
type ContainerExitedMessage ¶
type ContainerExitedMessage struct {
ContainerId string
}
type DockerEvent ¶
type DockerEvent struct { ImageUpdated *ImageUpdatedMessage ContainerExited *ContainerExitedMessage }
type DockerImageMonitor ¶
type DockerImageMonitor struct {
// contains filtered or unexported fields
}
func NewDockerImageMonitor ¶
func NewDockerImageMonitor(dockerClient *docker.Client, observer DockerImageObserver, ctx context.Context) *DockerImageMonitor
func (*DockerImageMonitor) RunAsync ¶
func (d *DockerImageMonitor) RunAsync(wg *sync.WaitGroup)
type DockerImageObserver ¶
type DockerImageObserver interface {
OnDockerEvent(msg DockerEvent)
}
type HTTPClientSettings ¶
type ImageUpdatedMessage ¶
Click to show internal directories.
Click to hide internal directories.