Documentation
¶
Index ¶
- func New() api.ResponseTransformer
- func NewReleaseTransformer() api.ReleaseResponseTransformer
- type Breakdown
- type ESReleaseHighlight
- type ESReleaseResponse
- type ESReleaseResponseAggregations
- type ESReleaseResponseHit
- type ESReleaseResponseItem
- type ESReleaseResponseSummary
- type ESReleaseSourceDocument
- type LegacyTransformer
- type Release
- type ReleaseDateChange
- type ReleaseDescription
- type ReleaseTransformer
- type SearchReleaseResponse
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReleaseTransformer ¶
func NewReleaseTransformer() api.ReleaseResponseTransformer
Types ¶
type Breakdown ¶
type Breakdown struct {
Total int `json:"total"`
Provisional int `json:"provisional,omitempty"`
Confirmed int `json:"confirmed,omitempty"`
Postponed int `json:"postponed,omitempty"`
Published int `json:"published,omitempty"`
Cancelled int `json:"cancelled,omitempty"`
Census int `json:"census,omitempty"`
}
type ESReleaseHighlight ¶
type ESReleaseResponse ¶
type ESReleaseResponse struct {
Responses []ESReleaseResponseItem `json:"responses"`
}
type ESReleaseResponseAggregations ¶
type ESReleaseResponseAggregations map[aggName]aggregation
type ESReleaseResponseHit ¶
type ESReleaseResponseHit struct {
Source ESReleaseSourceDocument `json:"_source"`
Highlight ESReleaseHighlight `json:"highlight"`
}
type ESReleaseResponseItem ¶
type ESReleaseResponseItem struct {
Took int `json:"took"`
TimedOut bool `json:"timed_out"`
Hits ESReleaseResponseSummary `json:"hits"`
Aggregations ESReleaseResponseAggregations `json:"aggregations"`
}
type ESReleaseResponseSummary ¶
type ESReleaseResponseSummary struct {
Total struct {
Value int `json:"value"`
} `json:"total"`
Hits []ESReleaseResponseHit `json:"hits"`
}
type ESReleaseSourceDocument ¶
type ESReleaseSourceDocument struct {
URI string `json:"uri"`
Title string `json:"title"`
Summary string `json:"summary"`
ReleaseDate string `json:"release_date,omitempty"`
Published bool `json:"published"`
Cancelled bool `json:"cancelled"`
Finalised bool `json:"finalised"`
Survey string `json:"survey"`
Keywords []string `json:"keywords,omitempty"`
Language string `json:"language,omitempty"`
DateChanges []dateChange `json:"date_changes,omitempty"`
ProvisionalDate string `json:"provisional_date,omitempty"`
}
type LegacyTransformer ¶
type LegacyTransformer struct {
// contains filtered or unexported fields
}
LegacyTransformer represents an instance of the ResponseTransformer interface
func (*LegacyTransformer) TransformCountResponse ¶ added in v1.32.0
TransformCountResponse is not supported for legacy transformer.
func (*LegacyTransformer) TransformSearchResponse ¶
func (t *LegacyTransformer) TransformSearchResponse(_ context.Context, responseData []byte, query string, highlight bool) ([]byte, error)
TransformSearchResponse transforms an elastic search response into a structure that matches the v1 api specification
type Release ¶
type Release struct {
URI string `json:"uri"`
DateChanges []ReleaseDateChange `json:"date_changes"`
Description ReleaseDescription `json:"description"`
Highlight *highlight `json:"highlight,omitempty"`
}
type ReleaseDateChange ¶
type ReleaseDescription ¶
type ReleaseDescription struct {
Title string `json:"title"`
Summary string `json:"summary"`
ReleaseDate string `json:"release_date"`
Published bool `json:"published"`
Cancelled bool `json:"cancelled"`
Finalised bool `json:"finalised"`
Postponed bool `json:"postponed"`
Census bool `json:"census"`
Keywords []string `json:"keywords,omitempty"`
ProvisionalDate string `json:"provisional_date,omitempty"`
Language string `json:"language,omitempty"`
CanonicalTopic string `json:"canonical_topic,omitempty"`
}
type ReleaseTransformer ¶
type ReleaseTransformer struct {
// contains filtered or unexported fields
}
func (*ReleaseTransformer) TransformSearchResponse ¶
func (t *ReleaseTransformer) TransformSearchResponse(_ context.Context, responseData []byte, req query.ReleaseSearchRequest, highlight bool) ([]byte, error)
TransformSearchResponse transforms an elastic search response to a release query into a serialised ReleaseResponse
type SearchReleaseResponse ¶
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer represents an instance of the ResponseTransformer interface for ES7x
func (*Transformer) TransformCountResponse ¶ added in v1.32.0
TransformCountResponse transforms an elastic search 7.x response
func (*Transformer) TransformSearchResponse ¶
func (t *Transformer) TransformSearchResponse( _ context.Context, responseData []byte, query string, highlight bool) ([]byte, error)
TransformSearchResponse transforms an elastic search 7.x response
Click to show internal directories.
Click to hide internal directories.