Drop Filter pointer

This commit is contained in:
Ian Gulliver
2023-04-23 03:28:33 +00:00
parent 59d3758c1c
commit c451e8d67a
4 changed files with 6 additions and 6 deletions

View File

@@ -28,7 +28,7 @@ func authBasic[T any](_ http.ResponseWriter, r *http.Request, api *API, name, pa
api,
name,
&ListOpts{
Filters: []*Filter{
Filters: []Filter{
{
Path: pathUser,
Op: "eq",

View File

@@ -22,7 +22,7 @@ func authBearer[T any](_ http.ResponseWriter, r *http.Request, api *API, name, p
api,
name,
&ListOpts{
Filters: []*Filter{
Filters: []Filter{
{
Path: pathToken,
Op: "eq",

View File

@@ -46,7 +46,7 @@ func Delete[TOut any](ctx context.Context, api *API, id string, opts *UpdateOpts
func FindName[TOut any](ctx context.Context, api *API, name, shortID string) (*TOut, error) {
listOpts := &ListOpts{
Filters: []*Filter{
Filters: []Filter{
{
Path: "id",
Op: "hp",

View File

@@ -24,7 +24,7 @@ type ListOpts struct {
Offset int64
After string
Sorts []string
Filters []*Filter
Filters []Filter
IfNoneMatch []httpheader.EntityTag
@@ -210,7 +210,7 @@ func (api *API) parseListOpts(r *http.Request) (*ListOpts, error) {
}
for _, val := range vals {
f := &Filter{
f := Filter{
Path: path,
Op: "eq",
Value: val,
@@ -257,7 +257,7 @@ func (api *API) filterList(ctx context.Context, cfg *config, opts *ListOpts, lis
return list, nil
}
func match(obj any, filters []*Filter) (bool, error) {
func match(obj any, filters []Filter) (bool, error) {
for _, filter := range filters {
var matches bool