searchindex

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package searchindex contains internal representation of the Atlas SearchIndex resource

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound means an resource is missing
	ErrNotFound = fmt.Errorf("not found")
)

Functions

This section is empty.

Types

type AtlasSearchIdxService

type AtlasSearchIdxService interface {
	GetIndex(ctx context.Context, projectID, clusterName, indexName, indexID string) (*SearchIndex, error)
	CreateIndex(ctx context.Context, projectID, clusterName string, index *SearchIndex) (*SearchIndex, error)
	DeleteIndex(ctx context.Context, projectID, clusterName, indexID string) error
	UpdateIndex(ctx context.Context, projectID, clusterName string, index *SearchIndex) (*SearchIndex, error)
}

type SearchIndex

type SearchIndex struct {
	akov2.SearchIndex
	akov2.AtlasSearchIndexConfigSpec
	ID     *string
	Status *string
}

SearchIndex is the internal representation of the Atlas SearchIndex resource for the AKO usage SearchIndexes represented differently in AKO as CRDs and in Atlas as atlas internal structures. Having a separate representation allows for simpler testing of the internal logic, not tied to AKO and Atlas structures

func NewSearchIndex

func NewSearchIndex(index *akov2.SearchIndex, config *akov2.AtlasSearchIndexConfigSpec) *SearchIndex

NewSearchIndex requires both parts of search index: data-related part from a Deployment, and index configuration represented in a separate CRD. Partial construction is disabled as it won't work for comparing indexes between each other.

func (*SearchIndex) EqualTo

func (s *SearchIndex) EqualTo(value *SearchIndex) (bool, error)

EqualTo compares two SearchIndexes using SemanticEqual method

func (*SearchIndex) GetID

func (s *SearchIndex) GetID() string

func (*SearchIndex) GetStatus

func (s *SearchIndex) GetStatus() string

func (*SearchIndex) Normalize

func (s *SearchIndex) Normalize() (*SearchIndex, error)

type SearchIndexes

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

func NewSearchIndexes

func NewSearchIndexes(api admin.AtlasSearchApi) *SearchIndexes

func (*SearchIndexes) CreateIndex

func (si *SearchIndexes) CreateIndex(ctx context.Context, projectID, clusterName string, index *SearchIndex) (*SearchIndex, error)

func (*SearchIndexes) DeleteIndex

func (si *SearchIndexes) DeleteIndex(ctx context.Context, projectID, clusterName, indexID string) error

func (*SearchIndexes) GetIndex

func (si *SearchIndexes) GetIndex(ctx context.Context, projectID, clusterName, indexName, indexID string) (*SearchIndex, error)

func (*SearchIndexes) UpdateIndex

func (si *SearchIndexes) UpdateIndex(ctx context.Context, projectID, clusterName string, index *SearchIndex) (*SearchIndex, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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