func (sys *Daemon) Status() (st Status, err error) {
	st = Status{Since: sys.since}

	for _, u := range sys.Units() {
		switch {
		case u.job == nil:
			continue
		case u.job.IsRunning():
			st.Jobs++
		case u.job.Failed():
			st.Failed++
		}
	}

	if st.Failed > 0 {
		st.State = Degraded
	} else {
		st.State = Running
	}

	st.Log, err = ioutil.ReadAll(sys.Log)

	return
}
// Status returns status of the system
// If error is returned it is going to be an error,
// returned by the call to ioutil.ReadAll(sys.Log)
Status returns status of the system
If error is returned it is going to be an error,
returned by the call to ioutil.ReadAll(sys.Log)
// Status returns status of the system // If error is returned it is going to be an error // returned by the call to ioutil . ReadAll ( sys . Log )
func (sys *Daemon) Status() (st Status, err error) {
	st = Status{Since: sys.since}
	for _, u := range sys.Units() {
		switch {
		case u.job == nil:
			continue
		case u.job.IsRunning():
			st.Jobs++
		case u.job.Failed():
			st.Failed++
		}
	}
	if st.Failed > 0 {
		st.State = Degraded
	} else {
		st.State = Running
	}
	st.Log, err = ioutil.ReadAll(sys.Log)
	return
}
func ( sys * Daemon ) Status ( ) ( st Status , err error ) { st = Status { Since : sys . since } for _ , u := range sys . Units ( ) { switch { case u . job == nil : continue case u . job . IsRunning ( ) : st . Jobs ++ case u . job . Failed ( ) : st . Failed ++ } } if st . Failed > 0 { st . State = Degraded } else { st . State = Running } st . Log , err = ioutil . ReadAll ( sys . Log ) return }
Status returns status of the system
If error is returned it is going to be an error,
returned by the call to ioutil.ReadAll(sys.Log)
Status returns status of the system If error is returned it is going to be an error returned by the call to ioutil . ReadAll ( sys . Log )