mocks

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	CloseIndexFn       func(ctx context.Context, index string) error
	CountFn            func(ctx context.Context, index string) (int, error)
	CreateIndexFn      func(ctx context.Context, index string, body map[string]any) error
	DeleteByQueryFn    func(ctx context.Context, req *searchstore.DeleteByQueryRequest) error
	DeleteIndexFn      func(ctx context.Context, index []string) error
	GetIndexAliasFn    func(ctx context.Context, name string) (map[string]any, error)
	GetIndexMappingsFn func(ctx context.Context, index string) (*searchstore.Mappings, error)
	GetIndicesStatsFn  func(ctx context.Context, pattern string) ([]searchstore.IndexStats, error)
	IndexFn            func(ctx context.Context, req *searchstore.IndexRequest) error
	IndexWithIDFn      func(ctx context.Context, req *searchstore.IndexWithIDRequest) error
	IndexExistsFn      func(ctx context.Context, index string) (bool, error)
	ListIndicesFn      func(ctx context.Context, indices []string) ([]string, error)
	PerformFn          func(req *http.Request) (*http.Response, error)
	PutIndexAliasFn    func(ctx context.Context, index []string, name string) error
	PutIndexMappingsFn func(ctx context.Context, index string, body map[string]any) error
	PutIndexSettingsFn func(ctx context.Context, index string, body map[string]any) error
	RefreshIndexFn     func(ctx context.Context, index string) error
	SearchFn           func(ctx context.Context, req *searchstore.SearchRequest) (*searchstore.SearchResponse, error)
	SendBulkRequestFn  func(ctx context.Context, items []searchstore.BulkItem) ([]searchstore.BulkItem, error)
	GetMapperFn        func() searchstore.Mapper
}

func (*Client) CloseIndex

func (m *Client) CloseIndex(ctx context.Context, index string) error

func (*Client) Count

func (m *Client) Count(ctx context.Context, index string) (int, error)

func (*Client) CreateIndex

func (m *Client) CreateIndex(ctx context.Context, index string, body map[string]any) error

func (*Client) DeleteByQuery

func (m *Client) DeleteByQuery(ctx context.Context, req *searchstore.DeleteByQueryRequest) error

func (*Client) DeleteIndex

func (m *Client) DeleteIndex(ctx context.Context, index []string) error

func (*Client) GetIndexAlias

func (m *Client) GetIndexAlias(ctx context.Context, name string) (map[string]any, error)

func (*Client) GetIndexMappings

func (m *Client) GetIndexMappings(ctx context.Context, index string) (*searchstore.Mappings, error)

func (*Client) GetIndicesStats

func (m *Client) GetIndicesStats(ctx context.Context, pattern string) ([]searchstore.IndexStats, error)

func (*Client) GetMapper

func (m *Client) GetMapper() searchstore.Mapper

func (*Client) Index

func (m *Client) Index(ctx context.Context, req *searchstore.IndexRequest) error

func (*Client) IndexExists

func (m *Client) IndexExists(ctx context.Context, index string) (bool, error)

func (*Client) IndexWithID

func (m *Client) IndexWithID(ctx context.Context, req *searchstore.IndexWithIDRequest) error

func (*Client) ListIndices

func (m *Client) ListIndices(ctx context.Context, indices []string) ([]string, error)

func (*Client) Perform

func (m *Client) Perform(req *http.Request) (*http.Response, error)

func (*Client) PutIndexAlias

func (m *Client) PutIndexAlias(ctx context.Context, index []string, name string) error

func (*Client) PutIndexMappings

func (m *Client) PutIndexMappings(ctx context.Context, index string, body map[string]any) error

func (*Client) PutIndexSettings

func (m *Client) PutIndexSettings(ctx context.Context, index string, body map[string]any) error

func (*Client) RefreshIndex

func (m *Client) RefreshIndex(ctx context.Context, index string) error

func (*Client) Search

func (*Client) SendBulkRequest

func (m *Client) SendBulkRequest(ctx context.Context, items []searchstore.BulkItem) ([]searchstore.BulkItem, error)

type Mapper

type Mapper struct {
	GetDefaultIndexSettingsFn func() map[string]any
	FieldMappingFn            func(*searchstore.Field) (map[string]any, error)
}

func (*Mapper) FieldMapping

func (m *Mapper) FieldMapping(f *searchstore.Field) (map[string]any, error)

func (*Mapper) GetDefaultIndexSettings

func (m *Mapper) GetDefaultIndexSettings() map[string]any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳