func (sys *SystemConfig) Users() []*User {
	cxn := sys.getDB()
	defer cxn.Close()

	if rows, err := cxn.Query("select Email, Name, Privileged from Users"); err != nil {
		panic(err)
	} else {
		defer rows.Close()

		ret := []*User{}
		for rows.Next() {
			u := &User{}
			rows.Scan(&u.Email, &u.Name, &u.Privileged)
			if u.Email == "" || u.Name == "" {
				panic(fmt.Errorf("user entry loaded with null fields '%s'/'%s'", u.Email, u.Name))
			}
			ret = append(ret, u)
		}

		sort.Slice(ret, func(i, j int) bool { return ret[i].Name < ret[j].Name })
		return ret
	}
}
// Users returns a list of all User rows currently configured. If there are no users, returns a nil
// slice.
Users returns a list of all User rows currently configured. If there are no users, returns a nil
slice.
// Users returns a list of all User rows currently configured . If there are no users returns a nil // slice .
func (sys *SystemConfig) Users() []*User {
	cxn := sys.getDB()
	defer cxn.Close()
	if rows, err := cxn.Query("select Email, Name, Privileged from Users"); err != nil {
		panic(err)
	} else {
		defer rows.Close()
		ret := []*User{}
		for rows.Next() {
			u := &User{}
			rows.Scan(&u.Email, &u.Name, &u.Privileged)
			if u.Email == "" || u.Name == "" {
				panic(fmt.Errorf("user entry loaded with null fields '%s'/'%s'", u.Email, u.Name))
			}
			ret = append(ret, u)
		}
		sort.Slice(ret, func(i, j int) bool { return ret[i].Name < ret[j].Name })
		return ret
	}
}
func ( sys * SystemConfig ) Users ( ) [ ] * User { cxn := sys . getDB ( ) defer cxn . Close ( ) if rows , err := cxn . Query ( " " ) ; err != nil { panic ( err ) } else { defer rows . Close ( ) ret := [ ] * User { } for rows . Next ( ) { u := & User { } rows . Scan ( & u . Email , & u . Name , & u . Privileged ) if u . Email == " " || u . Name == " " { panic ( fmt . Errorf ( " " , u . Email , u . Name ) ) } ret = append ( ret , u ) } sort . Slice ( ret , func ( i , j int ) bool { return ret [ i ] . Name < ret [ j ] . Name } ) return ret } }
Users returns a list of all User rows currently configured.
Users returns a list of all User rows currently configured .