solr_api

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 12 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 CallCollectionsApiV2 added in v0.8.0

func CallCollectionsApiV2(ctx context.Context, cloud *solr.SolrCloud, urlMethod string, urlPath string, urlParams url.Values, body interface{}, 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, errorBody *SolrErrorResponse) (apiUnsupported 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) (status string, err error)

func IsNotSupportedApiError added in v0.8.0

func IsNotSupportedApiError(errorBody *SolrErrorResponse) bool

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"`

	// +optional
	Error *SolrErrorResponse `json:"error,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"`

	// +optional
	Error *SolrErrorResponse `json:"error,omitempty"`
}

type SolrBackupListInstance added in v0.7.0

type SolrBackupListInstance struct {
	StartTime string `json:"startTime"`

	// +optional
	BackupId int `json:"backupId,omitempty"`
}

type SolrBackupListResponse added in v0.7.0

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

	Collection string `json:"collection"`

	// +optional
	Backups []SolrBackupListInstance `json:"backups,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"`

	// +optional
	Error *SolrErrorResponse `json:"error,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 SolrCollectionsListing added in v0.7.0

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

	// +optional
	Collections []string `json:"collections,omitempty"`

	// +optional
	Error *SolrErrorResponse `json:"error,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"`

	// +optional
	Error *SolrErrorResponse `json:"error,omitempty"`
}

type SolrErrorMetadata added in v0.8.0

type SolrErrorMetadata struct {
	ErrorClass string `json:"error-class,omitempty"`

	RootErrorClass string `json:"root-error-class,omitempty"`
}

type SolrErrorResponse added in v0.8.0

type SolrErrorResponse struct {
	Metadata SolrErrorMetadata `json:"metadata,omitempty"`

	Message string `json:"msg,omitempty"`

	Code int `json:"code,omitempty"`
}

func (SolrErrorResponse) Error added in v0.8.0

func (e SolrErrorResponse) Error() string

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"`

	// +optional
	Error *SolrErrorResponse `json:"error,omitempty"`
}

type SolrRebalanceRequest added in v0.8.0

type SolrRebalanceRequest struct {
	Nodes []string `json:"nodes,omitempty"`

	WaitForFinalState bool `json:"waitForFinalState,omitempty"`

	Async string `json:"async,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