solr

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Action             = "action"
	ActionBackup       = "BACKUP"
	ActionRestore      = "RESTORE"
	ActionCreate       = "CREATE"
	ActionDeleteBackup = "DELETEBACKUP"
	AddRole            = "ADDROLE"
	RemoveRole         = "REMOVEROLE"
	Name               = "name"
	Role               = "role"
	Node               = "node"
	Location           = "location"
	Repository         = "repository"
	Collection         = "collection"
	Async              = "async"
	Replica            = "replica"
	MoveReplica        = "MOVEREPLICA"
	PurgeUnused        = "purgeUnused"
	TargetNode         = "targetNode"
	BackupId           = "backupId"
	DeleteStatus       = "DELETESTATUS"
	RequestStatus      = "REQUESTSTATUS"
	RequestId          = "requestid"
	NumShards          = "numShards"
	ReplicationFactor  = "replicationFactor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ADD

type ADD struct {
	Add *Data `json:"add,omitempty" yaml:"add,omitempty"`
}

type ADDList

type ADDList []ADD

type BalanceReplica added in v0.3.0

type BalanceReplica struct {
	WaitForFinalState bool   `json:"waitForFinalState,omitempty" yaml:"waitForFinalState,omitempty"`
	Async             string `json:"async,omitempty" yaml:"async,omitempty"`
}

type Client

type Client struct {
	SLClient
}

func (*Client) Balance added in v0.3.0

func (sc *Client) Balance() error

func (*Client) BalanceReplicaManual added in v0.3.0

func (sc *Client) BalanceReplicaManual(db *dbapi.Solr, desired int) error

func (*Client) CheckupStatus added in v0.3.0

func (sc *Client) CheckupStatus(async string) error

func (*Client) CleanupAsync added in v0.3.0

func (sc *Client) CleanupAsync(async string) error

func (*Client) DecodeCollectionHealth

func (sc *Client) DecodeCollectionHealth(responseBody map[string]interface{}) error

func (*Client) DecodeResponse

func (sc *Client) DecodeResponse(response *Response) (map[string]interface{}, error)

func (*Client) Down added in v0.3.0

func (sc *Client) Down(nodeList []string, x int, mp map[string][]CoreList) error

func (*Client) FlushAsyncStatus added in v0.3.0

func (sc *Client) FlushAsyncStatus(asyncId string) error

func (*Client) GetAsyncStatus

func (sc *Client) GetAsyncStatus(responseBody map[string]interface{}) (string, error)

func (*Client) GetCollectionList

func (sc *Client) GetCollectionList(responseBody map[string]interface{}) ([]string, error)

func (*Client) GetResponseStatus

func (sc *Client) GetResponseStatus(responseBody map[string]interface{}) (int, error)

func (*Client) Run added in v0.3.0

func (sc *Client) Run(lst []UpdateList) error

func (*Client) SearchCollection

func (sc *Client) SearchCollection(collections []string) bool

func (*Client) Up added in v0.3.0

func (sc *Client) Up(nodeList []string, mp map[string][]CoreList) error

func (*Client) UpReplicaManual added in v0.3.0

func (sc *Client) UpReplicaManual(db *dbapi.Solr) error

type ClientOptions

type ClientOptions struct {
	KBClient client.Client
	DB       *api.Solr
	Ctx      context.Context
	Log      logr.Logger
}

type Config

type Config struct {
	// contains filtered or unexported fields
}

type CoreList added in v0.3.0

type CoreList struct {
	// contains filtered or unexported fields
}

type CreateParams

type CreateParams struct {
	Name              string `json:"name,omitempty" yaml:"name,omitempty"`
	Config            string `json:"config,omitempty" yaml:"config,omitempty"`
	NumShards         int    `json:"numShards,omitempty" yaml:"numShards,omitempty"`
	ReplicationFactor int    `json:"replicationFactor,omitempty" yaml:"replicationFactor,omitempty"`
}

type Data

type Data struct {
	CommitWithin int  `json:"commitWithin,omitempty" yaml:"commitWithin,omitempty"`
	Overwrite    bool `json:"overwrite,omitempty" yaml:"overwrite,omitempty"`
	Doc          *Doc `json:"doc,omitempty" yaml:"doc,omitempty"`
}

type Doc

type Doc struct {
	Id int    `json:"id,omitempty" yaml:"id,omitempty"`
	DB string `json:"db,omitempty" yaml:"db,omitempty"`
}

type KubeDBClientBuilder

type KubeDBClientBuilder struct {
	// contains filtered or unexported fields
}

func NewKubeDBClientBuilder

func NewKubeDBClientBuilder(kc client.Client, db *api.Solr) *KubeDBClientBuilder

func (*KubeDBClientBuilder) GetHostPath

func (o *KubeDBClientBuilder) GetHostPath(db *api.Solr) string

func (*KubeDBClientBuilder) GetSolrClient

func (o *KubeDBClientBuilder) GetSolrClient() (*Client, error)

func (*KubeDBClientBuilder) WithContext

func (*KubeDBClientBuilder) WithLog

func (*KubeDBClientBuilder) WithPod

func (o *KubeDBClientBuilder) WithPod(podName string) *KubeDBClientBuilder

func (*KubeDBClientBuilder) WithURL

type MoveReplicaInfo added in v0.3.0

type MoveReplicaInfo struct {
	Replica    string `json:"replica,omitempty" yaml:"replica,omitempty"`
	TargetNode string `json:"targetNode,omitempty" yaml:"targetNode,omitempty"`
	Async      string `json:"async,omitempty" yaml:"async,omitempty"`
}

type MoveReplicaParams added in v0.3.0

type MoveReplicaParams struct {
	MoveReplica MoveReplicaInfo `json:"move-replica,omitempty" yaml:"move-replica,omitempty"`
}

type QueryParams

type QueryParams struct {
	Query string `json:"query,omitempty" yaml:"query,omitempty"`
	Limit int    `json:"limit,omitempty" yaml:"limit,omitempty"`
}

type Response

type Response struct {
	Code int
	// contains filtered or unexported fields
}

type SLClient

type SLClient interface {
	GetClusterStatus() (*Response, error)
	ListCollection() (*Response, error)
	CreateCollection() (*Response, error)
	WriteCollection() (*Response, error)
	ReadCollection() (*Response, error)
	BackupCollection(ctx context.Context, collection string, backupName string, location string, repository string) (*Response, error)
	RestoreCollection(ctx context.Context, collection string, backupName string, location string, repository string, backupId int) (*Response, error)
	FlushStatus(asyncId string) (*Response, error)
	RequestStatus(asyncId string) (*Response, error)
	DeleteBackup(ctx context.Context, backupName string, collection string, location string, repository string, backupId int, snap string) (*Response, error)
	PurgeBackup(ctx context.Context, backupName string, collection string, location string, repository string, snap string) (*Response, error)
	GetConfig() *Config
	GetClient() *resty.Client
	GetLog() logr.Logger
	DecodeBackupResponse(data map[string]interface{}, collection string) ([]byte, error)
	MoveReplica(target string, replica string, collection string, async string) (*Response, error)
	BalanceReplica(async string) (*Response, error)
	AddRole(role, node string) (*Response, error)
	RemoveRole(role, node string) (*Response, error)
}

type SLClientV8

type SLClientV8 struct {
	Client *resty.Client
	Config *Config
}

func (*SLClientV8) AddRole added in v0.3.0

func (sc *SLClientV8) AddRole(role, node string) (*Response, error)

func (*SLClientV8) BackupCollection

func (sc *SLClientV8) BackupCollection(ctx context.Context, collection string, backupName string, location string, repository string) (*Response, error)

func (*SLClientV8) BalanceReplica added in v0.3.0

func (sc *SLClientV8) BalanceReplica(async string) (*Response, error)

func (*SLClientV8) CreateCollection

func (sc *SLClientV8) CreateCollection() (*Response, error)

func (*SLClientV8) DecodeBackupResponse

func (sc *SLClientV8) DecodeBackupResponse(data map[string]interface{}, collection string) ([]byte, error)

func (*SLClientV8) DeleteBackup

func (sc *SLClientV8) DeleteBackup(ctx context.Context, backupName string, collection string, location string, repository string, backupId int, snap string) (*Response, error)

func (*SLClientV8) FlushStatus

func (sc *SLClientV8) FlushStatus(asyncId string) (*Response, error)

func (*SLClientV8) GetClient

func (sc *SLClientV8) GetClient() *resty.Client

func (*SLClientV8) GetClusterStatus

func (sc *SLClientV8) GetClusterStatus() (*Response, error)

func (*SLClientV8) GetConfig

func (sc *SLClientV8) GetConfig() *Config

func (*SLClientV8) GetLog

func (sc *SLClientV8) GetLog() logr.Logger

func (*SLClientV8) ListCollection

func (sc *SLClientV8) ListCollection() (*Response, error)

func (*SLClientV8) MoveReplica added in v0.3.0

func (sc *SLClientV8) MoveReplica(target string, replica string, collection string, async string) (*Response, error)

func (*SLClientV8) PurgeBackup

func (sc *SLClientV8) PurgeBackup(ctx context.Context, backupName string, collection string, location string, repository string, snap string) (*Response, error)

func (*SLClientV8) ReadCollection

func (sc *SLClientV8) ReadCollection() (*Response, error)

func (*SLClientV8) RemoveRole added in v0.3.0

func (sc *SLClientV8) RemoveRole(role, node string) (*Response, error)

func (*SLClientV8) RequestStatus

func (sc *SLClientV8) RequestStatus(asyncId string) (*Response, error)

func (*SLClientV8) RestoreCollection

func (sc *SLClientV8) RestoreCollection(ctx context.Context, collection string, backupName string, location string, repository string, backupId int) (*Response, error)

func (*SLClientV8) WriteCollection

func (sc *SLClientV8) WriteCollection() (*Response, error)

type SLClientV9

type SLClientV9 struct {
	Client *resty.Client
	Config *Config
}

func (*SLClientV9) AddRole added in v0.3.0

func (sc *SLClientV9) AddRole(role, node string) (*Response, error)

func (*SLClientV9) BackupCollection

func (sc *SLClientV9) BackupCollection(ctx context.Context, collection string, backupName string, location string, repository string) (*Response, error)

func (*SLClientV9) BalanceReplica added in v0.3.0

func (sc *SLClientV9) BalanceReplica(async string) (*Response, error)

func (*SLClientV9) CreateCollection

func (sc *SLClientV9) CreateCollection() (*Response, error)

func (*SLClientV9) DecodeBackupResponse

func (sc *SLClientV9) DecodeBackupResponse(data map[string]interface{}, collection string) ([]byte, error)

func (*SLClientV9) DeleteBackup

func (sc *SLClientV9) DeleteBackup(ctx context.Context, backupName string, collection string, location string, repository string, backupId int, snap string) (*Response, error)

func (*SLClientV9) FlushStatus

func (sc *SLClientV9) FlushStatus(asyncId string) (*Response, error)

func (*SLClientV9) GetClient

func (sc *SLClientV9) GetClient() *resty.Client

func (*SLClientV9) GetClusterStatus

func (sc *SLClientV9) GetClusterStatus() (*Response, error)

func (*SLClientV9) GetConfig

func (sc *SLClientV9) GetConfig() *Config

func (*SLClientV9) GetLog

func (sc *SLClientV9) GetLog() logr.Logger

func (*SLClientV9) ListCollection

func (sc *SLClientV9) ListCollection() (*Response, error)

func (*SLClientV9) MoveReplica added in v0.3.0

func (sc *SLClientV9) MoveReplica(target string, replica string, collection string, async string) (*Response, error)

func (*SLClientV9) PurgeBackup

func (sc *SLClientV9) PurgeBackup(ctx context.Context, backupName string, collection string, location string, repository string, snap string) (*Response, error)

func (*SLClientV9) ReadCollection

func (sc *SLClientV9) ReadCollection() (*Response, error)

func (*SLClientV9) RemoveRole added in v0.3.0

func (sc *SLClientV9) RemoveRole(role, node string) (*Response, error)

func (*SLClientV9) RequestStatus

func (sc *SLClientV9) RequestStatus(asyncId string) (*Response, error)

func (*SLClientV9) RestoreCollection

func (sc *SLClientV9) RestoreCollection(ctx context.Context, collection string, backupName string, location string, repository string, backupId int) (*Response, error)

func (*SLClientV9) WriteCollection

func (sc *SLClientV9) WriteCollection() (*Response, error)

type UpdateList added in v0.3.0

type UpdateList struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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