reindex

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadBodyFailed      = errors.New("failed to read response body")
	ErrUnmarshalBodyFailed = errors.New("failed to unmarshal response body")
	ErrSettingServiceAuth  = errors.New("error setting service auth token")
	ErrResponseBodyEmpty   = errors.New("response body empty")
)

A list of error messages for creating a new index

Functions

This section is empty.

Types

type NewIndexName

type NewIndexName struct {
	IndexName string
}

type Reindex

type Reindex struct {
}

Reindex is a type that contains an implementation of the Indexer interface, which can be used for calling the Search API.

func (*Reindex) CreateIndex

func (r *Reindex) CreateIndex(ctx context.Context, serviceAuthToken, searchAPISearchURL string, httpClient dphttp.Clienter) (*http.Response, error)

CreateIndex calls the Search API via the Do function of the dp-net/v2/http/Clienter. It passes in the ServiceAuthToken to identify itself, as the Search Reindex API, to the Search API.

func (*Reindex) GetIndexNameFromResponse

func (r *Reindex) GetIndexNameFromResponse(ctx context.Context, body io.ReadCloser) (string, error)

GetIndexNameFromResponse unmarshalls the response body, which is passed into the function, and extracts the IndexName, which it then returns

Jump to

Keyboard shortcuts

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