func (n *DockerStatusWidget) Init() (err error) {
	if err = m2s.Decode(n.options.Content, &n.containers); err != nil {
		return err
	}
	if err = n.buildGauges(); err != nil {
		return
	}
	go func() {
		endpoint := "unix:///var/run/docker.sock"
		n.client, err = docker.NewClient(endpoint)
		if err != nil {
			return
		}
		for _, g := range n.gauges {
			var id string
			id, err = n.getContainerIDByName(g.container)
			if err != nil {
				return
			}
			active := true
			if id == "" {
				active = false
				g.gauge.Label = "'" + g.container + "' is not running "
			}
			g.id = id
			g.active = active
		}
	}()
	return
}
// Init is the implementation of widget.Init
Init is the implementation of widget.Init
// Init is the implementation of widget . Init
func (n *DockerStatusWidget) Init() (err error) {
	if err = m2s.Decode(n.options.Content, &n.containers); err != nil {
		return err
	}
	if err = n.buildGauges(); err != nil {
		return
	}
	go func() {
		endpoint := "unix:///var/run/docker.sock"
		n.client, err = docker.NewClient(endpoint)
		if err != nil {
			return
		}
		for _, g := range n.gauges {
			var id string
			id, err = n.getContainerIDByName(g.container)
			if err != nil {
				return
			}
			active := true
			if id == "" {
				active = false
				g.gauge.Label = "'" + g.container + "' is not running "
			}
			g.id = id
			g.active = active
		}
	}()
	return
}
func ( n * DockerStatusWidget ) Init ( ) ( err error ) { if err = m2s . Decode ( n . options . Content , & n . containers ) ; err != nil { return err } if err = n . buildGauges ( ) ; err != nil { return } go func ( ) { endpoint := " " n . client , err = docker . NewClient ( endpoint ) if err != nil { return } for _ , g := range n . gauges { var id string id , err = n . getContainerIDByName ( g . container ) if err != nil { return } active := true if id == " " { active = false g . gauge . Label = " " + g . container + " " } g . id = id g . active = active } } ( ) return }
Init is the implementation of widget.Init
Init is the implementation of widget . Init