types

package
v0.0.0-...-812b362 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BooleanQuery

type BooleanQuery struct {
	Must   []Json `json:"must"`
	Should []Json `json:"should"`
	Filter []Json `json:"filter"`
}

Used for SearchEndpointRequests.

type BulkRequestCreate

type BulkRequestCreate struct {
	Create struct {
		Index string `json:"_index"`
		Id    string `json:"_id"`
	} `json:"create"`
}

Used for making OpenSearch /_bulk requests.

type ClubSearchRequest

type ClubSearchRequest struct {
	Search     string   `json:"search"`
	MinMembers int      `json:"min_members"`
	MaxMembers int      `json:"max_members"`
	Tags       []string `json:"tags"`
}

JSON parameters for an API GET /api/v1/search/clubs request.

func (*ClubSearchRequest) Index

func (q *ClubSearchRequest) Index() string

func (*ClubSearchRequest) Preload

func (q *ClubSearchRequest) Preload(db *gorm.DB) *gorm.DB

func (*ClubSearchRequest) ToSearchEndpointRequest

func (q *ClubSearchRequest) ToSearchEndpointRequest() SearchEndpointRequest

To Query DSL JSON

type EventSearchRequest

type EventSearchRequest struct {
	Search    string             `json:"search"`
	StartTime time.Time          `json:"start_time"`
	EndTime   time.Time          `json:"end_time"`
	EventType []models.EventType `json:"event_type"`
	Clubs     []string           `json:"clubs"`
	Tags      []string           `json:"tags"`
}

JSON parameters for an API GET /api/v1/search/events request.

func (*EventSearchRequest) Index

func (q *EventSearchRequest) Index() string

func (*EventSearchRequest) Preload

func (q *EventSearchRequest) Preload(db *gorm.DB) *gorm.DB

func (*EventSearchRequest) ToSearchEndpointRequest

func (q *EventSearchRequest) ToSearchEndpointRequest() SearchEndpointRequest

To Query DSL JSON

type Json

type Json map[string]interface{}

type SearchEndpointRequest

type SearchEndpointRequest Json

Used for making OpenSearch GET /<index>/_search requests. OpenSearch's DSL is such that we can't make this a nice static struct with all the fields specified; depending on what we are looking to search we'll need to add different clauses.

type SearchEndpointResponse

type SearchEndpointResponse struct {
	Hits struct {
		Hits []struct {
			Index string  `json:"_index"`
			Score float32 `json:"_score"`
			Id    string  `json:"_id"`
		} `json:"hits"`
	} `json:"hits"`
}

Used for responses from OpenSearch GET /<index>/_search requests.

type SearchRequest

type SearchRequest interface {
	ToSearchEndpointRequest() SearchEndpointRequest
	Index() string
	Preload(db *gorm.DB) *gorm.DB
}

type SearchResult

type SearchResult[T models.Event | models.Club] struct {
	Results []T `json:"results"`
}

type Searchable

type Searchable interface {
	models.Club | models.Event
	Preload(db *gorm.DB) *gorm.DB
}

type ToSearchDocument

type ToSearchDocument interface {
	ToSearchDocument() interface{}
}

Jump to

Keyboard shortcuts

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