Documentation ¶
Index ¶
- func AddBasicAuthHeader(request *http.Request, solrConfig *SolrConfig)
- func AddNegotiateHeader(request *http.Request, solrConfig *SolrConfig)
- func GenerateIniFile(iniFileLocation string)
- func GenerateSolrConfig(iniFileLocation string) (SolrConfig, SSHConfig)
- func GenerateSolrData(solrConfig *SolrConfig, sshConfig *SSHConfig, iniFileLocation string)
- func GetSolrCollectionUri(solrConfig *SolrConfig, uriSuffix string) string
- type BasicAuthConfig
- type KerberosConfig
- type SSHConfig
- type SecurityConfig
- type SolrClient
- type SolrConfig
- type SolrDataProcessor
- type SolrDocument
- type SolrDocuments
- type SolrQuery
- func (q *SolrQuery) AddFacet(field string)
- func (q *SolrQuery) AddFields(fields []string)
- func (q *SolrQuery) AddParam(key, value string)
- func (q *SolrQuery) AddPivotFields(pivotFields []string)
- func (q *SolrQuery) Encode() string
- func (q *SolrQuery) FacetQuery(query string)
- func (q *SolrQuery) FilterQuery(filterQuery string)
- func (q *SolrQuery) Query(query string)
- func (q *SolrQuery) Rows(rows int)
- func (q *SolrQuery) SetParam(key, value string)
- func (q *SolrQuery) Sort(sort string)
- func (q *SolrQuery) Start(start int)
- type SolrResponse
- type SolrResponseData
- type SolrResponseHeader
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBasicAuthHeader ¶
func AddBasicAuthHeader(request *http.Request, solrConfig *SolrConfig)
AddBasicAuthHeader add Auth header with basic auth credentials
func AddNegotiateHeader ¶
func AddNegotiateHeader(request *http.Request, solrConfig *SolrConfig)
AddNegotiateHeader add WWW-Authenticate header (SPNEGO) in case of kerberos is enabled
func GenerateIniFile ¶
func GenerateIniFile(iniFileLocation string)
GenerateIniFile create an ini file to a specific location
func GenerateSolrConfig ¶
func GenerateSolrConfig(iniFileLocation string) (SolrConfig, SSHConfig)
GenerateSolrConfig create sample ini file for Solr data generation
func GenerateSolrData ¶
func GenerateSolrData(solrConfig *SolrConfig, sshConfig *SSHConfig, iniFileLocation string)
GenerateSolrData Use to generate Solr data, also scp keytab file to local if kerberos and ssl config is enabled
func GetSolrCollectionUri ¶
func GetSolrCollectionUri(solrConfig *SolrConfig, uriSuffix string) string
GetSolrCollectionUri gather Solr collection url with url context (if exists) and url suffix e.g.: url - https://myurl:8886, context: /solr, suffix: /update/json/docs = https://myurl:8886/solr/update/json/docs
Types ¶
type BasicAuthConfig ¶
type BasicAuthConfig struct {
// contains filtered or unexported fields
}
BasicAuthConfig hold authentication credentials
type KerberosConfig ¶
type KerberosConfig struct {
// contains filtered or unexported fields
}
KerberosConfig holds kerberos related configurations
type SSHConfig ¶
type SSHConfig struct { Enabled bool Username string PrivateKeyPath string DownloadLocation string RemoteKrb5Conf string RemoteKeytab string Hostname string }
SSHConfig holds SSH related configs that is used by the data generator (to gather keytabs if kerberos is enabled)
type SecurityConfig ¶
type SecurityConfig struct {
// contains filtered or unexported fields
}
SecurityConfig holds security related configurations
func InitSecurityConfig ¶
func InitSecurityConfig(krb5Path string, keytabPath string, principal string, realm string) SecurityConfig
InitSecurityConfig set initial security config on start
type SolrClient ¶
type SolrClient struct {
// contains filtered or unexported fields
}
SolrClient represents a Solr connection that is used to communicate with Solr HTTP endpoints
func NewSolrClient ¶
func NewSolrClient(solrConfig *SolrConfig) (*SolrClient, error)
NewSolrClient initialize a new Solr client based on configuration type
func (*SolrClient) Query ¶
func (solrClient *SolrClient) Query(solrQuery *SolrQuery) (bool, *SolrResponseData, error)
Query get Solr data based on parameters
func (*SolrClient) Update ¶
func (solrClient *SolrClient) Update(docs interface{}, parameters *url.Values, commit bool) (bool, *SolrResponseData, error)
Update send documents to Solr
type SolrConfig ¶
type SolrConfig struct { Url string Collection string SecurityConfig *SecurityConfig SolrUrlContext string TlsConfig TLSConfig Insecure bool ConnectTimeoutSeconds int }
SolrConfig holds Solr related configurations
type SolrDataProcessor ¶
type SolrDataProcessor struct { BatchContext *processor.BatchContext Mutex *sync.Mutex SolrClient *SolrClient }
SolrDataProcessor type for processing Solr data
func (SolrDataProcessor) GetBatchContext ¶
func (p SolrDataProcessor) GetBatchContext() *processor.BatchContext
GetBatchContext gather batch context that will be used by processor
func (SolrDataProcessor) HandleError ¶
func (p SolrDataProcessor) HandleError(err error)
HandleError handle errors during time based buffer processing (it is not used by this generator)
func (SolrDataProcessor) Process ¶
func (p SolrDataProcessor) Process() error
Process send gathered data to Solr
type SolrDocument ¶
type SolrDocument map[string]interface{}
SolrDocument represents a Solr document (document map)
type SolrQuery ¶
type SolrQuery struct {
// contains filtered or unexported fields
}
SolrQuery represents a solr query object
func CreateSolrQuery ¶
func CreateSolrQuery() *SolrQuery
CreateSolrQuery will create a new Solr query with empty queries
func (*SolrQuery) AddPivotFields ¶
AddFields adding fields to Solr query
func (*SolrQuery) FacetQuery ¶
FacetQuery sets facet query string
func (*SolrQuery) FilterQuery ¶
FilterQuery add filter query string
type SolrResponse ¶
type SolrResponse struct { NumFound int32 `json:"numFound,omitempty"` Start int32 `json:"start,omitempty"` MaxScore float32 `json:"maxScore,omitempty"` Docs []SolrDocument `json:"docs,omitempty"` }
SolrResponse represents a Solr HTTP response
type SolrResponseData ¶
type SolrResponseData struct { ResponseHeader SolrResponseHeader `json:"responseHeader"` Response SolrResponse `json:"response"` }
SolrResponseData represents Solr response data that contains the response itself and the response header as well