solr_api

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_HEADERS_CONTEXT_KEY = "HTTP_HEADERS"
)

Variables

This section is empty.

Functions

func CallCollectionsApi

func CallCollectionsApi(ctx context.Context, cloud *solr.SolrCloud, urlParams url.Values, response interface{}) (err error)

func CheckAsyncRequest added in v0.5.0

func CheckAsyncRequest(ctx context.Context, cloud *solr.SolrCloud, asyncId string) (asyncState string, message string, err error)

func CheckForCollectionsApiError

func CheckForCollectionsApiError(action string, header SolrResponseHeader) (hasError bool, err error)

func CollectionsAPIError

func CollectionsAPIError(action string, responseStatus int) error

func DeleteAsyncRequest added in v0.5.0

func DeleteAsyncRequest(ctx context.Context, cloud *solr.SolrCloud, asyncId string) (message string, err error)

func SetMTLSHttpClient

func SetMTLSHttpClient(client *http.Client)

func SetNoVerifyTLSHttpClient

func SetNoVerifyTLSHttpClient(client *http.Client)

Types

type APIError

type APIError struct {
	Detail string
	Status int // API-specific error code
}

func (APIError) Error

func (e APIError) Error() string

type CollectionRouterName

type CollectionRouterName string

CollectionRouterName is a string enumeration type that enumerates the ways that documents can be routed for a collection.

const (
	ImplicitRouter    CollectionRouterName = "implicit"
	CompositeIdRouter CollectionRouterName = "compositeId"
)

type SolrAsyncResponse

type SolrAsyncResponse struct {
	ResponseHeader SolrResponseHeader `json:"responseHeader"`

	// +optional
	RequestId string `json:"requestId,omitempty"`

	// +optional
	Status SolrAsyncStatus `json:"status,omitempty"`
}

type SolrAsyncStatus

type SolrAsyncStatus struct {
	// Possible states can be found here: https://github.com/apache/solr/blob/releases/lucene-solr%2F8.8.1/solr/solrj/src/java/org/apache/solr/client/solrj/response/RequestStatusState.java
	// +optional
	AsyncState string `json:"state,omitempty"`

	// +optional
	Message string `json:"msg,omitempty"`
}

type SolrAsyncStatusResponse added in v0.5.0

type SolrAsyncStatusResponse struct {
	ResponseHeader SolrResponseHeader `json:"responseHeader"`

	// +optional
	Status SolrAsyncStatus `json:"status,omitempty"`
}

type SolrClusterStatus

type SolrClusterStatus struct {
	// +optional
	Collections map[string]SolrCollectionStatus `json:"collections,omitempty"`

	// +optional
	Aliases map[string]string `json:"aliases,omitempty"`

	// +optional
	Roles map[string][]string `json:"roles,omitempty"`

	// +optional
	LiveNodes []string `json:"live_nodes,omitempty"`
}

type SolrClusterStatusResponse

type SolrClusterStatusResponse struct {
	ResponseHeader SolrResponseHeader `json:"responseHeader"`

	// +optional
	ClusterStatus SolrClusterStatus `json:"cluster,omitempty"`
}

type SolrCollectionRouter

type SolrCollectionRouter struct {
	Name CollectionRouterName `json:"name"`
}

type SolrCollectionStatus

type SolrCollectionStatus struct {
	// +optional
	Shards map[string]SolrShardStatus `json:"shards,omitempty"`

	// +optional
	ConfigName string `json:"configName,omitempty"`

	// +optional
	ZnodeVersion intstr.IntOrString `json:"znodeVersion,omitempty"`

	// +optional
	AutoAddReplicas string `json:"autoAddReplicas,omitempty"`

	// +optional
	NrtReplicas intstr.IntOrString `json:"nrtReplicas,omitempty"`

	// +optional
	TLogReplicas intstr.IntOrString `json:"tlogReplicas,omitempty"`

	// +optional
	PullReplicas intstr.IntOrString `json:"pullReplicas,omitempty"`

	// +optional
	MaxShardsPerNode intstr.IntOrString `json:"maxShardsPerNode,omitempty"`

	// +optional
	ReplicationFactor intstr.IntOrString `json:"replicationFactor,omitempty"`

	// +optional
	Router SolrCollectionRouter `json:"router,omitempty"`
}

type SolrDeleteRequestStatus added in v0.5.0

type SolrDeleteRequestStatus struct {
	ResponseHeader SolrResponseHeader `json:"responseHeader"`

	// Status of the delete request
	// +optional
	Status string `json:"status,omitempty"`
}

type SolrOverseerStatusResponse

type SolrOverseerStatusResponse struct {
	ResponseHeader SolrResponseHeader `json:"responseHeader"`

	// +optional
	Leader string `json:"leader,omitempty"`

	// +optional
	QueueSize int `json:"overseer_queue_size,omitempty"`

	// +optional
	WorkQueueSize int `json:"overseer_work_queue_size,omitempty"`

	// +optional
	CollectionQueueSize int `json:"overseer_collection_queue_size,omitempty"`
}

type SolrReplaceNodeResponse added in v0.5.0

type SolrReplaceNodeResponse struct {
	ResponseHeader SolrResponseHeader `json:"responseHeader"`

	// +optional
	Success string `json:"success,omitempty"`

	// +optional
	Failure string `json:"failure,omitempty"`
}

type SolrReplicaState

type SolrReplicaState string
const (
	ReplicaActive         SolrReplicaState = "active"
	ReplicaDown           SolrReplicaState = "down"
	ReplicaRecovering     SolrReplicaState = "recovering"
	ReplicaRecoveryFailed SolrReplicaState = "recovery_failed"
)

type SolrReplicaStatus

type SolrReplicaStatus struct {
	State SolrReplicaState `json:"state"`

	Core string `json:"core"`

	NodeName string `json:"node_name"`

	BaseUrl string `json:"base_url"`

	Leader bool `json:"leader,string"`

	// +optional
	Type SolrReplicaType `json:"type,omitempty"`
}

type SolrReplicaType

type SolrReplicaType string
const (
	NRT  SolrReplicaType = "NRT"
	TLOG SolrReplicaType = "TLOG"
	PULL SolrReplicaType = "PULL"
)

type SolrResponseHeader

type SolrResponseHeader struct {
	Status int `json:"status"`

	QTime int `json:"QTime"`
}

type SolrShardState

type SolrShardState string
const (
	ShardActive SolrShardState = "active"
	ShardDown   SolrShardState = "down"
)

type SolrShardStatus

type SolrShardStatus struct {
	// +optional
	Replicas map[string]SolrReplicaStatus `json:"replicas,omitempty"`

	// +optional
	Range string `json:"range,omitempty"`

	// +optional
	State SolrShardState `json:"state,omitempty"`
}

Jump to

Keyboard shortcuts

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