Skip to content

Instantly share code, notes, and snippets.

@bprashanth
Created October 19, 2015 23:19
Show Gist options
  • Save bprashanth/99b9b393210c8d8f55fc to your computer and use it in GitHub Desktop.
Save bprashanth/99b9b393210c8d8f55fc to your computer and use it in GitHub Desktop.
var dc = dockerClient{*docker.ArgDockerEndpoint}
type dockerClient struct {
endpoint string
c *dclient
lock mutex
}
func (d *dockerClient) getClient() (client, err) {
d.Lock()
defer d.Unlock()
if d.c == nil {
d.c, _ = NewClient(d.endpoint)
}
return d.c, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment