Skip to content

Commit 758f557

Browse files
author
hanix
committed
added pagination to Roles
1 parent 4208b8c commit 758f557

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

api/rolestore/client.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,18 @@ func (store *RoleStore) LinkedRoles(awsroleID string) ([]AWSRoleLink, error) {
183183
}
184184

185185
// Roles gets all configured roles.
186-
func (store *RoleStore) Roles() ([]Role, error) {
186+
func (store *RoleStore) Roles(offset, limit int, sortkey, sortdir string) ([]Role, error) {
187187
result := rolesResult{}
188188

189+
filters := Params{
190+
Offset: offset,
191+
Limit: limit,
192+
Sortkey: sortkey,
193+
Sortdir: sortdir,
194+
}
195+
189196
_, err := store.api.
190-
URL("/role-store/api/v1/roles").
191-
Get(&result)
197+
URL("/role-store/api/v1/roles").Query(filters).Get(&result)
192198

193199
return result.Items, err
194200
}

0 commit comments

Comments
 (0)