Documentation
¶
Index ¶
- Constants
- func FormatMultiQuery(rawQuery []byte) ([]byte, error)
- func LegacyFormatMultiQuery(rawQuery []byte) ([]byte, error)
- func SetupSearch() (*template.Template, error)
- func SetupV710Search() (*template.Template, error)
- type Builder
- type Date
- type InvalidDateString
- type InvalidReleaseTypeString
- type InvalidSortString
- type LegacyReleaseSearchRequest
- func (sr LegacyReleaseSearchRequest) CensusClause() string
- func (sr LegacyReleaseSearchRequest) HighlightClause() string
- func (sr LegacyReleaseSearchRequest) ReleaseTypeClause() string
- func (sr *LegacyReleaseSearchRequest) Set(value string) error
- func (sr LegacyReleaseSearchRequest) SortClause() string
- type ParamValidator
- type ReleaseBuilder
- type ReleaseSearchRequest
- func (sr ReleaseSearchRequest) CensusClause() string
- func (sr ReleaseSearchRequest) HighlightClause() string
- func (sr ReleaseSearchRequest) Now() string
- func (sr ReleaseSearchRequest) ReleaseTypeClause() string
- func (sr *ReleaseSearchRequest) Set(value string) error
- func (sr ReleaseSearchRequest) SortClause() string
- func (sr *ReleaseSearchRequest) String() string
- type ReleaseType
- type Sort
Constants ¶
const ( Separator = "," EmptyClause = `{}` NoProvisionalNoConfirmedPostponed = ` {"term":{"finalised":true}}, {"exists":{"field":"date_changes"}} ` NoProvisionalConfirmedNoPostponed = ` {"term":{"finalised":true}}, {"bool":{"must_not":{"exists":{"field":"date_changes"}}}} ` NoProvisionalConfirmedPostponed = ` {"term":{"finalised":true}} ` ProvisionalNoConfirmedNoPostponed = ` {"term":{"finalised":false}} ` ProvisionalNoConfirmedPostponed = `` /* 215-byte string literal not displayed */ ProvisionalConfirmedNoPostponed = `` /* 237-byte string literal not displayed */ LegacyNoProvisionalNoConfirmedPostponed = ` {"term":{"description.finalised":true}}, {"exists":{"field":"dateChanges"}} ` LegacyNoProvisionalConfirmedNoPostponed = ` {"term":{"description.finalised":true}}, {"bool":{"must_not":{"exists":{"field":"dateChanges"}}}} ` LegacyNoProvisionalConfirmedPostponed = ` {"term":{"description.finalised":true}} ` LegacyProvisionalNoConfirmedNoPostponed = ` {"term":{"description.finalised":false}} ` LegacyProvisionalNoConfirmedPostponed = `` /* 238-byte string literal not displayed */ LegacyProvisionalConfirmedNoPostponed = `` /* 260-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func FormatMultiQuery ¶
FormatMultiQuery minifies and reformats an elasticsearch MultiQuery
func LegacyFormatMultiQuery ¶
LegacyFormatMultiQuery minifies and reformats an elasticsearch MultiQuery
func SetupSearch ¶
SetupSearch loads templates for use by the search handler and should be done only once
func SetupV710Search ¶
SetupV710Search loads v710 templates for use by the search handler and should be done only once
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder represents an instance of a query builder
func NewQueryBuilder ¶
NewQueryBuilder loads the elastic search templates and returns a query builder instance
type Date ¶
func MustParseDate ¶
type InvalidDateString ¶
type InvalidDateString struct {
// contains filtered or unexported fields
}
func (InvalidDateString) Error ¶
func (ids InvalidDateString) Error() string
type InvalidReleaseTypeString ¶
type InvalidReleaseTypeString string
func (InvalidReleaseTypeString) Error ¶
func (irts InvalidReleaseTypeString) Error() string
type InvalidSortString ¶
type InvalidSortString string
func (InvalidSortString) Error ¶
func (iss InvalidSortString) Error() string
type LegacyReleaseSearchRequest ¶ added in v1.24.0
type LegacyReleaseSearchRequest struct {
ReleaseSearchRequest
}
func (LegacyReleaseSearchRequest) CensusClause ¶ added in v1.24.0
func (sr LegacyReleaseSearchRequest) CensusClause() string
func (LegacyReleaseSearchRequest) HighlightClause ¶ added in v1.24.0
func (sr LegacyReleaseSearchRequest) HighlightClause() string
func (LegacyReleaseSearchRequest) ReleaseTypeClause ¶ added in v1.24.0
func (sr LegacyReleaseSearchRequest) ReleaseTypeClause() string
ReleaseTypeClause returns the query clause to select the type of release Note that it is possible for a Release to have both its Published and Cancelled flags true (yes indeed!) In this case it is deemed cancelled
func (*LegacyReleaseSearchRequest) Set ¶ added in v1.24.0
func (sr *LegacyReleaseSearchRequest) Set(value string) error
func (LegacyReleaseSearchRequest) SortClause ¶ added in v1.24.0
func (sr LegacyReleaseSearchRequest) SortClause() string
type ParamValidator ¶
type ParamValidator map[paramName]validator
func NewReleaseQueryParamValidator ¶
func NewReleaseQueryParamValidator() ParamValidator
type ReleaseBuilder ¶
type ReleaseBuilder struct {
// contains filtered or unexported fields
}
func NewReleaseBuilder ¶
func NewReleaseBuilder(v710 bool) (*ReleaseBuilder, error)
func (*ReleaseBuilder) BuildSearchQuery ¶
func (rb *ReleaseBuilder) BuildSearchQuery(_ context.Context, searchRequest interface{}) ([]byte, error)
BuildSearchQuery builds an elastic search query from the provided search parameters for Release Calendars
type ReleaseSearchRequest ¶
type ReleaseSearchRequest struct {
Term string
From int
Size int
SortBy Sort
ReleasedAfter Date
ReleasedBefore Date
Type ReleaseType
Provisional bool
Confirmed bool
Postponed bool
Census bool
Highlight bool
}
func (ReleaseSearchRequest) CensusClause ¶
func (sr ReleaseSearchRequest) CensusClause() string
func (ReleaseSearchRequest) HighlightClause ¶
func (sr ReleaseSearchRequest) HighlightClause() string
func (ReleaseSearchRequest) Now ¶
func (sr ReleaseSearchRequest) Now() string
func (ReleaseSearchRequest) ReleaseTypeClause ¶
func (sr ReleaseSearchRequest) ReleaseTypeClause() string
ReleaseTypeClause returns the query clause to select the type of release Note that it is possible for a Release to have both its Published and Cancelled flags true (yes indeed!) In this case it is deemed cancelled
func (*ReleaseSearchRequest) Set ¶
func (sr *ReleaseSearchRequest) Set(value string) error
func (ReleaseSearchRequest) SortClause ¶
func (sr ReleaseSearchRequest) SortClause() string
func (*ReleaseSearchRequest) String ¶
func (sr *ReleaseSearchRequest) String() string
type ReleaseType ¶
type ReleaseType int
const ( InvalidReleaseType ReleaseType = iota Upcoming Published Cancelled )
func MustParseReleaseType ¶
func MustParseReleaseType(s string) ReleaseType
func ParseReleaseType ¶
func ParseReleaseType(s string) (ReleaseType, error)
func (ReleaseType) String ¶
func (rt ReleaseType) String() string