func fetchSessions()

in sessions/sessions.go [83:93]


func fetchSessions(b *backends.Backend) ([]*resources.Session, error) {
	backendRespBytes, err := b.Get(APIPath)
	if err != nil {
		return nil, fmt.Errorf("failure reading the sessions from %q: %w", b.Name(), err)
	}
	var sessions []*resources.Session
	if err := json.Unmarshal(backendRespBytes, &sessions); err != nil {
		return nil, fmt.Errorf("failure parsing the sessions response from %q: %w", b.Name(), err)
	}
	return sessions, nil
}