this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

helper to merge query params

+30
+30
search/query.go
··· 72 72 Size int `json:"size"` 73 73 } 74 74 75 + // Merges params from another param object in to this one. Intended to meld parsed query with HTTP query params, so not all functionality is supported, and priority is with the "current" object 76 + func (p *PostSearchParams) Update(other *PostSearchParams) { 77 + p.Query = other.Query 78 + if p.Author == nil { 79 + p.Author = other.Author 80 + } 81 + if p.Since == nil { 82 + p.Since = other.Since 83 + } 84 + if p.Until == nil { 85 + p.Until = other.Until 86 + } 87 + if p.Mentions == nil { 88 + p.Mentions = other.Mentions 89 + } 90 + if p.Lang == nil { 91 + p.Lang = other.Lang 92 + } 93 + if p.Domain == "" { 94 + p.Domain = other.Domain 95 + } 96 + if p.URL == "" { 97 + p.URL = other.URL 98 + } 99 + if len(p.Tags) == 0 { 100 + p.Tags = other.Tags 101 + } 102 + } 103 + 104 + // turns search params in to actual elasticsearch/opensearch filter DSL 75 105 func (p *PostSearchParams) Filters() []map[string]interface{} { 76 106 var filters []map[string]interface{} 77 107