filter

package
v0.0.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

README

filter

import "github.com/agentstation/starmap/internal/server/filter"

Package filter provides query parameter parsing and filtering for API endpoints.

Index

type ModelFilter

ModelFilter contains all possible filter criteria for models.

type ModelFilter struct {
    // Basic filters
    ID           string
    Name         string
    NameContains string
    Provider     string

    // Modality filters
    ModalityInput  []string
    ModalityOutput []string

    // Feature filters
    Features map[string]bool

    // Metadata filters
    Tags        []string
    OpenWeights *bool

    // Numeric range filters
    MinContext int64
    MaxContext int64
    MinOutput  int64
    MaxOutput  int64

    // Date filters
    ReleasedAfter  *time.Time
    ReleasedBefore *time.Time

    // Pagination
    Sort       string
    Order      string
    Limit      int
    Offset     int
    MaxResults int
}

func ParseModelFilter
func ParseModelFilter(r *http.Request) ModelFilter

ParseModelFilter extracts model filter parameters from HTTP request.

func (ModelFilter) Apply
func (f ModelFilter) Apply(models []catalogs.Model) []catalogs.Model

Apply applies the filter to a list of models and returns filtered results.

Generated by gomarkdoc

Documentation

Overview

Package filter provides query parameter parsing and filtering for API endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModelFilter

type ModelFilter struct {
	// Basic filters
	ID           string
	Name         string
	NameContains string
	Provider     string

	// Modality filters
	ModalityInput  []string
	ModalityOutput []string

	// Feature filters
	Features map[string]bool

	// Metadata filters
	Tags        []string
	OpenWeights *bool

	// Numeric range filters
	MinContext int64
	MaxContext int64
	MinOutput  int64
	MaxOutput  int64

	// Date filters
	ReleasedAfter  *time.Time
	ReleasedBefore *time.Time

	// Pagination
	Sort       string
	Order      string
	Limit      int
	Offset     int
	MaxResults int
}

ModelFilter contains all possible filter criteria for models.

func ParseModelFilter

func ParseModelFilter(r *http.Request) ModelFilter

ParseModelFilter extracts model filter parameters from HTTP request.

func (ModelFilter) Apply

func (f ModelFilter) Apply(models []catalogs.Model) []catalogs.Model

Apply applies the filter to a list of models and returns filtered results.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL