Skip to content

Instantly share code, notes, and snippets.

@judell
Created May 5, 2024 00:40
Show Gist options
  • Save judell/99b642cf0ed031e32e15dacb58cd5a82 to your computer and use it in GitHub Desktop.
Save judell/99b642cf0ed031e32e15dacb58cd5a82 to your computer and use it in GitHub Desktop.
callListAnything.go
func listDevices(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
var visitor ListPredicate = func(client *kolide.Client, cursor string, limit int32, searches ...kolide.Search) (interface{}, error) {
return client.GetDevices(cursor, limit, searches...)
}
return listAnything(ctx, d, h, "kolide_device.listDevices", visitor, "Devices")
}
func listAdminUsers(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
var visitor ListPredicate = func(client *kolide.Client, cursor string, limit int32, searches ...kolide.Search) (interface{}, error) {
return client.GetAdminUsers(cursor, limit, searches...)
}
return listAnything(ctx, d, h, "kolide_admin_user.listAdminUsers", visitor, "AdminUsers")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment