Skip to content

Commit 8f5f829

Browse files
author
Aaron Schlesinger
committed
fix(data): create new filter func on the cluster interface
1 parent 70fdf20 commit 8f5f829

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

data/cluster.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ type Cluster interface {
1111
Get(*sql.DB, string) (types.Cluster, error)
1212
Set(*sql.DB, string, types.Cluster) (types.Cluster, error)
1313
Checkin(*sql.DB, string, types.Cluster) (sql.Result, error)
14+
FilterByAge(*sql.DB, *ClusterAgeFilter) ([]types.Cluster, error)
1415
}

data/cluster_from_db.go

+7
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,10 @@ func (c ClusterFromDB) Checkin(db *sql.DB, id string, cluster types.Cluster) (sq
8282
}
8383
return result, nil
8484
}
85+
86+
// FilterByAge returns a slice of clusters whose various time fields match the requirements
87+
// in the given filter. Note that the filter's requirements are a conjunction, not a disjunction
88+
func (c ClusterFromDB) FilterByAge(db *sql.DB, filter *ClusterAgeFilter) ([]types.Cluster, error) {
89+
// TODO: impl
90+
return nil, nil
91+
}

0 commit comments

Comments
 (0)