search

package
v0.0.0-testrgm6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: AGPL-3.0 Imports: 9 Imported by: 671

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SortAlphaAsc = model.SortOption{
		Name:        "alpha-asc",
		DisplayName: "Alphabetically (A–Z)",
		Description: "Sort results in an alphabetically ascending order",
		Index:       0,
		Filter: []model.SortOptionFilter{
			searchstore.TitleSorter{},
		},
	}
	SortAlphaDesc = model.SortOption{
		Name:        "alpha-desc",
		DisplayName: "Alphabetically (Z–A)",
		Description: "Sort results in an alphabetically descending order",
		Index:       0,
		Filter: []model.SortOptionFilter{
			searchstore.TitleSorter{Descending: true},
		},
	}
)

Functions

This section is empty.

Types

type Query

type Query struct {
	Title         string
	Tags          []string
	OrgId         int64
	SignedInUser  *user.SignedInUser
	Limit         int64
	Page          int64
	IsStarred     bool
	Type          string
	DashboardUIDs []string
	DashboardIds  []int64
	FolderIds     []int64
	Permission    dashboards.PermissionType
	Sort          string
}

type SearchService

type SearchService struct {
	Cfg *setting.Cfg
	// contains filtered or unexported fields
}

func ProvideService

func ProvideService(cfg *setting.Cfg, sqlstore db.DB, starService star.Service, dashboardService dashboards.DashboardService) *SearchService

func (*SearchService) RegisterSortOption

func (s *SearchService) RegisterSortOption(option model.SortOption)

RegisterSortOption allows for hooking in more search options from other services.

func (*SearchService) SearchHandler

func (s *SearchService) SearchHandler(ctx context.Context, query *Query) (model.HitList, error)

func (*SearchService) SortOptions

func (s *SearchService) SortOptions() []model.SortOption

type Service

type Service interface {
	SearchHandler(context.Context, *Query) (model.HitList, error)
	SortOptions() []model.SortOption
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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