meilisearch

package module
v0.0.0-...-f213e53 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 21 Imported by: 0

README

Meilisearch-Go

Meilisearch Go

Meilisearch | Meilisearch Cloud | Documentation | Discord | Roadmap | Website | FAQ

GitHub Workflow Status Test License Bors enabled

⚡ The Meilisearch API client written for Golang

Meilisearch Go is the Meilisearch API client for Go developers.

Meilisearch is an open-source search engine. Learn more about Meilisearch.

Table of Contents

📖 Documentation

This readme contains all the documentation you need to start using this Meilisearch SDK.

For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our main documentation website.

⚡ Supercharge your Meilisearch experience

Say goodbye to server deployment and manual updates with Meilisearch Cloud. Get started with a 14-day free trial! No credit card required.

🔧 Installation

With go get in command line:

go get github.com/meilisearch/meilisearch-go

Run Meilisearch

There are many easy ways to download and run a Meilisearch instance.

For example, using the curl command in your Terminal:

# Install Meilisearch
curl -L https://install.meilisearch.com | sh

# Launch Meilisearch
./meilisearch --master-key=masterKey

NB: you can also download Meilisearch from Homebrew or APT or even run it using Docker.

🚀 Getting started

Add documents
package main

import (
	"fmt"
	"os"

	"github.com/meilisearch/meilisearch-go"
)

func main() {
	client := meilisearch.NewClient(meilisearch.ClientConfig{
                Host: "http://127.0.0.1:7700",
                APIKey: "masterKey",
        })
	// An index is where the documents are stored.
	index := client.Index("movies")

	// If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.
	documents := []map[string]interface{}{
        { "id": 1, "title": "Carol", "genres": []string{"Romance", "Drama"} },
        { "id": 2, "title": "Wonder Woman", "genres": []string{"Action", "Adventure"} },
        { "id": 3, "title": "Life of Pi", "genres": []string{"Adventure", "Drama"} },
        { "id": 4, "title": "Mad Max: Fury Road", "genres": []string{"Adventure", "Science Fiction"} },
        { "id": 5, "title": "Moana", "genres": []string{"Fantasy", "Action"} },
        { "id": 6, "title": "Philadelphia", "genres": []string{"Drama"} },
	}
	task, err := index.AddDocuments(documents)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	fmt.Println(task.TaskUID)
}

With the taskUID, you can check the status (enqueued, canceled, processing, succeeded or failed) of your documents addition using the task endpoint.

package main

import (
    "fmt"
    "os"

    "github.com/meilisearch/meilisearch-go"
)

func main() {
    // Meilisearch is typo-tolerant:
    searchRes, err := client.Index("movies").Search("philoudelphia",
        &meilisearch.SearchRequest{
            Limit: 10,
        })
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    fmt.Println(searchRes.Hits)
}

JSON output:

{
  "hits": [{
    "id": 6,
    "title": "Philadelphia",
    "genres": ["Drama"]
  }],
  "offset": 0,
  "limit": 10,
  "processingTimeMs": 1,
  "query": "philoudelphia"
}

All the supported options are described in the search parameters section of the documentation.

func main() {
    searchRes, err := client.Index("movies").Search("wonder",
        &meilisearch.SearchRequest{
            AttributesToHighlight: []string{"*"},
        })
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    fmt.Println(searchRes.Hits)
}

JSON output:

{
    "hits": [
        {
            "id": 2,
            "title": "Wonder Woman",
            "genres": ["Action", "Adventure"],
            "_formatted": {
                "id": 2,
                "title": "<em>Wonder</em> Woman"
            }
        }
    ],
    "offset": 0,
    "limit": 20,
    "processingTimeMs": 0,
    "query": "wonder"
}
Custom Search With Filters

If you want to enable filtering, you must add your attributes to the filterableAttributes index setting.

task, err := index.UpdateFilterableAttributes(&[]string{"id", "genres"})

You only need to perform this operation once.

Note that Meilisearch will rebuild your index whenever you update filterableAttributes. Depending on the size of your dataset, this might take time. You can track the process using the task status.

Then, you can perform the search:

searchRes, err := index.Search("wonder",
    &meilisearch.SearchRequest{
        Filter: "id > 1 AND genres = Action",
    })
{
  "hits": [
    {
      "id": 2,
      "title": "Wonder Woman",
      "genres": ["Action","Adventure"]
    }
  ],
  "offset": 0,
  "limit": 20,
  "estimatedTotalHits": 1,
  "processingTimeMs": 0,
  "query": "wonder"
}

🤖 Compatibility with Meilisearch

This package guarantees compatibility with version v1.x of Meilisearch, but some features may not be present. Please check the issues for more info.

💡 Learn more

The following sections in our main documentation website may interest you:

⚙️ Contributing

Any new contribution is more than welcome in this project!

If you want to know more about the development workflow or want to contribute, please visit our contributing guidelines for detailed instructions!


Meilisearch provides and maintains many SDKs and Integration tools like this one. We want to provide everyone with an amazing search experience for any kind of project. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the integration-guides repository.

Documentation

Index

Constants

View Source
const (
	DefaultLimit int64 = 20
)

This constant contains the default values assigned by Meilisearch to the limit in search parameters

Documentation: https://www.meilisearch.com/docs/reference/api/search#search-parameters

View Source
const VERSION = "0.26.3"

Variables

View Source
var ErrNoSearchRequest = errors.New("no search request provided")

Functions

func GetQualifiedVersion

func GetQualifiedVersion() (qualifiedVersion string)

func IsValidUUID

func IsValidUUID(uuid string) bool

func VersionErrorHintMessage

func VersionErrorHintMessage(err error, req *internalRequest) error

Added a hint to the error message if it may come from a version incompatibility with Meilisearch

Types

type CancelTasksQuery

type CancelTasksQuery struct {
	UIDS             []int64
	IndexUIDS        []string
	Statuses         []TaskStatus
	Types            []TaskType
	BeforeEnqueuedAt time.Time
	AfterEnqueuedAt  time.Time
	BeforeStartedAt  time.Time
	AfterStartedAt   time.Time
}

CancelTasksQuery is a list of filter available to send as query parameters

func (CancelTasksQuery) MarshalEasyJSON

func (v CancelTasksQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CancelTasksQuery) MarshalJSON

func (v CancelTasksQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CancelTasksQuery) UnmarshalEasyJSON

func (v *CancelTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CancelTasksQuery) UnmarshalJSON

func (v *CancelTasksQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Client

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

Client is a structure that give you the power for interacting with an high-level api with Meilisearch.

func NewClient

func NewClient(config ClientConfig) *Client

NewClient creates Meilisearch with default fasthttp.Client

func NewFastHTTPCustomClient

func NewFastHTTPCustomClient(config ClientConfig, client *fasthttp.Client) *Client

NewFastHTTPCustomClient creates Meilisearch with custom fasthttp.Client

func (*Client) CancelTasks

func (c *Client) CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error)

func (*Client) CreateDump

func (c *Client) CreateDump() (resp *TaskInfo, err error)

func (*Client) CreateIndex

func (c *Client) CreateIndex(config *IndexConfig) (resp *TaskInfo, err error)

func (*Client) CreateKey

func (c *Client) CreateKey(request *Key) (resp *Key, err error)

func (*Client) DeleteIndex

func (c *Client) DeleteIndex(uid string) (resp *TaskInfo, err error)

func (*Client) DeleteKey

func (c *Client) DeleteKey(keyOrUID string) (resp bool, err error)

func (*Client) DeleteTasks

func (c *Client) DeleteTasks(param *DeleteTasksQuery) (resp *TaskInfo, err error)

func (*Client) GenerateTenantToken

func (c *Client) GenerateTenantToken(APIKeyUID string, SearchRules map[string]interface{}, Options *TenantTokenOptions) (resp string, err error)

Generate a JWT token for the use of multitenancy

SearchRules parameters is mandatory and should contains the rules to be enforced at search time for all or specific accessible indexes for the signing API Key. ExpiresAt options is a time.Time when the key will expire. Note that if an ExpiresAt value is included it should be in UTC time. ApiKey options is the API key parent of the token. If you leave it empty the client API Key will be used.

func (*Client) GetIndex

func (c *Client) GetIndex(uid string) (resp *Index, err error)

func (*Client) GetIndexes

func (c *Client) GetIndexes(param *IndexesQuery) (resp *IndexesResults, err error)

func (*Client) GetKey

func (c *Client) GetKey(identifier string) (resp *Key, err error)

func (*Client) GetKeys

func (c *Client) GetKeys(param *KeysQuery) (resp *KeysResults, err error)

func (*Client) GetRawIndex

func (c *Client) GetRawIndex(uid string) (resp map[string]interface{}, err error)

func (*Client) GetRawIndexes

func (c *Client) GetRawIndexes(param *IndexesQuery) (resp map[string]interface{}, err error)

func (*Client) GetStats

func (c *Client) GetStats() (resp *Stats, err error)

func (*Client) GetTask

func (c *Client) GetTask(taskUID int64) (resp *Task, err error)

func (*Client) GetTasks

func (c *Client) GetTasks(param *TasksQuery) (resp *TaskResult, err error)

func (*Client) GetVersion

func (c *Client) GetVersion() (resp *Version, err error)

func (*Client) Health

func (c *Client) Health() (resp *Health, err error)

func (*Client) Index

func (c *Client) Index(uid string) *Index

func (*Client) IsHealthy

func (c *Client) IsHealthy() bool

func (Client) MarshalEasyJSON

func (v Client) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Client) MarshalJSON

func (v Client) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Client) MultiSearch

func (c *Client) MultiSearch(queries *MultiSearchRequest) (*MultiSearchResponse, error)

func (*Client) SwapIndexes

func (c *Client) SwapIndexes(param []SwapIndexesParams) (resp *TaskInfo, err error)

func (*Client) UnmarshalEasyJSON

func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Client) UnmarshalJSON

func (v *Client) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Client) UpdateKey

func (c *Client) UpdateKey(keyOrUID string, request *Key) (resp *Key, err error)

func (*Client) Version

func (c *Client) Version() (resp *Version, err error)

func (*Client) WaitForTask

func (c *Client) WaitForTask(taskUID int64, options ...WaitParams) (*Task, error)

WaitForTask waits for a task to be processed

The function will check by regular interval provided in parameter interval the TaskStatus. If no ctx and interval are provided WaitForTask will check each 50ms the status of a task.

type ClientConfig

type ClientConfig struct {
	// Host is the host of your Meilisearch database
	// Example: 'http://localhost:7700'
	Host string

	// APIKey is optional
	APIKey string

	// Timeout is optional
	Timeout time.Duration
}

ClientConfig configure the Client

type ClientInterface

type ClientInterface interface {
	Index(uid string) *Index
	GetIndex(indexID string) (resp *Index, err error)
	GetRawIndex(uid string) (resp map[string]interface{}, err error)
	GetIndexes(param *IndexesQuery) (resp *IndexesResults, err error)
	GetRawIndexes(param *IndexesQuery) (resp map[string]interface{}, err error)
	CreateIndex(config *IndexConfig) (resp *TaskInfo, err error)
	DeleteIndex(uid string) (resp *TaskInfo, err error)
	CreateKey(request *Key) (resp *Key, err error)
	MultiSearch(queries *MultiSearchRequest) (*MultiSearchResponse, error)
	GetKey(identifier string) (resp *Key, err error)
	GetKeys(param *KeysQuery) (resp *KeysResults, err error)
	UpdateKey(keyOrUID string, request *Key) (resp *Key, err error)
	DeleteKey(keyOrUID string) (resp bool, err error)
	GetStats() (resp *Stats, err error)
	CreateDump() (resp *TaskInfo, err error)
	Version() (*Version, error)
	GetVersion() (resp *Version, err error)
	Health() (*Health, error)
	IsHealthy() bool
	GetTask(taskUID int64) (resp *Task, err error)
	GetTasks(param *TasksQuery) (resp *TaskResult, err error)
	CancelTasks(param *CancelTasksQuery) (resp *TaskInfo, err error)
	DeleteTasks(param *DeleteTasksQuery) (resp *TaskInfo, err error)
	SwapIndexes(param []SwapIndexesParams) (resp *TaskInfo, err error)
	WaitForTask(taskUID int64, options ...WaitParams) (*Task, error)
	GenerateTenantToken(APIKeyUID string, searchRules map[string]interface{}, options *TenantTokenOptions) (resp string, err error)
}

ClientInterface is interface for all Meilisearch client

type CreateIndexRequest

type CreateIndexRequest struct {
	UID        string `json:"uid,omitempty"`
	PrimaryKey string `json:"primaryKey,omitempty"`
}

CreateIndexRequest is the request body for create index method

func (CreateIndexRequest) MarshalEasyJSON

func (v CreateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateIndexRequest) MarshalJSON

func (v CreateIndexRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateIndexRequest) UnmarshalEasyJSON

func (v *CreateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateIndexRequest) UnmarshalJSON

func (v *CreateIndexRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CsvDocumentsQuery

type CsvDocumentsQuery struct {
	PrimaryKey   string `json:"primaryKey,omitempty"`
	CsvDelimiter string `json:"csvDelimiter,omitempty"`
}

func (CsvDocumentsQuery) MarshalEasyJSON

func (v CsvDocumentsQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CsvDocumentsQuery) MarshalJSON

func (v CsvDocumentsQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CsvDocumentsQuery) UnmarshalEasyJSON

func (v *CsvDocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CsvDocumentsQuery) UnmarshalJSON

func (v *CsvDocumentsQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DeleteTasksQuery

type DeleteTasksQuery struct {
	UIDS             []int64
	IndexUIDS        []string
	Statuses         []TaskStatus
	Types            []TaskType
	CanceledBy       []int64
	BeforeEnqueuedAt time.Time
	AfterEnqueuedAt  time.Time
	BeforeStartedAt  time.Time
	AfterStartedAt   time.Time
	BeforeFinishedAt time.Time
	AfterFinishedAt  time.Time
}

DeleteTasksQuery is a list of filter available to send as query parameters

func (DeleteTasksQuery) MarshalEasyJSON

func (v DeleteTasksQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DeleteTasksQuery) MarshalJSON

func (v DeleteTasksQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DeleteTasksQuery) UnmarshalEasyJSON

func (v *DeleteTasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DeleteTasksQuery) UnmarshalJSON

func (v *DeleteTasksQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Details

type Details struct {
	ReceivedDocuments    int64               `json:"receivedDocuments,omitempty"`
	IndexedDocuments     int64               `json:"indexedDocuments,omitempty"`
	DeletedDocuments     int64               `json:"deletedDocuments,omitempty"`
	PrimaryKey           string              `json:"primaryKey,omitempty"`
	ProvidedIds          int64               `json:"providedIds,omitempty"`
	RankingRules         []string            `json:"rankingRules,omitempty"`
	DistinctAttribute    *string             `json:"distinctAttribute,omitempty"`
	SearchableAttributes []string            `json:"searchableAttributes,omitempty"`
	DisplayedAttributes  []string            `json:"displayedAttributes,omitempty"`
	StopWords            []string            `json:"stopWords,omitempty"`
	Synonyms             map[string][]string `json:"synonyms,omitempty"`
	FilterableAttributes []string            `json:"filterableAttributes,omitempty"`
	SortableAttributes   []string            `json:"sortableAttributes,omitempty"`
	TypoTolerance        *TypoTolerance      `json:"typoTolerance,omitempty"`
	Pagination           *Pagination         `json:"pagination,omitempty"`
	Faceting             *Faceting           `json:"faceting,omitempty"`
	MatchedTasks         int64               `json:"matchedTasks,omitempty"`
	CanceledTasks        int64               `json:"canceledTasks,omitempty"`
	DeletedTasks         int64               `json:"deletedTasks,omitempty"`
	OriginalFilter       string              `json:"originalFilter,omitempty"`
	Swaps                []SwapIndexesParams `json:"swaps,omitempty"`
	DumpUid              string              `json:"dumpUid,omitempty"`
}

func (Details) MarshalEasyJSON

func (v Details) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Details) MarshalJSON

func (v Details) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Details) UnmarshalEasyJSON

func (v *Details) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Details) UnmarshalJSON

func (v *Details) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DocumentQuery

type DocumentQuery struct {
	Fields []string `json:"fields,omitempty"`
}

DocumentQuery is the request body get one documents method

func (DocumentQuery) MarshalEasyJSON

func (v DocumentQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DocumentQuery) MarshalJSON

func (v DocumentQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DocumentQuery) UnmarshalEasyJSON

func (v *DocumentQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DocumentQuery) UnmarshalJSON

func (v *DocumentQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DocumentsQuery

type DocumentsQuery struct {
	Offset int64       `json:"offset,omitempty"`
	Limit  int64       `json:"limit,omitempty"`
	Fields []string    `json:"fields,omitempty"`
	Filter interface{} `json:"filter,omitempty"`
}

DocumentsQuery is the request body for list documents method

func (DocumentsQuery) MarshalEasyJSON

func (v DocumentsQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DocumentsQuery) MarshalJSON

func (v DocumentsQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DocumentsQuery) UnmarshalEasyJSON

func (v *DocumentsQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DocumentsQuery) UnmarshalJSON

func (v *DocumentsQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type DocumentsResult

type DocumentsResult struct {
	Results []map[string]interface{} `json:"results"`
	Limit   int64                    `json:"limit"`
	Offset  int64                    `json:"offset"`
	Total   int64                    `json:"total"`
}

func (DocumentsResult) MarshalEasyJSON

func (v DocumentsResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (DocumentsResult) MarshalJSON

func (v DocumentsResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*DocumentsResult) UnmarshalEasyJSON

func (v *DocumentsResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*DocumentsResult) UnmarshalJSON

func (v *DocumentsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Embedder

type Embedder struct {
	Source           string `json:"source"`
	ApiKey           string `json:"apiKey,omitempty"`
	Model            string `json:"model,omitempty"`
	Dimensions       int    `json:"dimensions,omitempty"`
	DocumentTemplate string `json:"documentTemplate,omitempty"`
}

func (Embedder) MarshalEasyJSON

func (v Embedder) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Embedder) MarshalJSON

func (v Embedder) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Embedder) UnmarshalEasyJSON

func (v *Embedder) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Embedder) UnmarshalJSON

func (v *Embedder) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ErrCode

type ErrCode int

ErrCode are all possible errors found during requests

const (
	// ErrCodeUnknown default error code, undefined
	ErrCodeUnknown ErrCode = 0
	// ErrCodeMarshalRequest impossible to serialize request body
	ErrCodeMarshalRequest ErrCode = iota + 1
	// ErrCodeResponseUnmarshalBody impossible deserialize the response body
	ErrCodeResponseUnmarshalBody
	// MeilisearchApiError send by the Meilisearch api
	MeilisearchApiError
	// MeilisearchApiError send by the Meilisearch api
	MeilisearchApiErrorWithoutMessage
	// MeilisearchTimeoutError
	MeilisearchTimeoutError
	// MeilisearchCommunicationError impossible execute a request
	MeilisearchCommunicationError
)

type Error

type Error struct {
	// Endpoint is the path of the request (host is not in)
	Endpoint string

	// Method is the HTTP verb of the request
	Method string

	// Function name used
	Function string

	// RequestToString is the raw request into string ('empty request' if not present)
	RequestToString string

	// RequestToString is the raw request into string ('empty response' if not present)
	ResponseToString string

	// Error info from Meilisearch api
	// Message is the raw request into string ('empty Meilisearch message' if not present)
	MeilisearchApiError meilisearchApiError

	// StatusCode of the request
	StatusCode int

	// StatusCode expected by the endpoint to be considered as a success
	StatusCodeExpected []int

	// OriginError is the origin error that produce the current Error. It can be nil in case of a bad status code.
	OriginError error

	// ErrCode is the internal error code that represent the different step when executing a request that can produce
	// an error.
	ErrCode ErrCode
	// contains filtered or unexported fields
}

Error is the internal error structure that all exposed method use. So ALL errors returned by this library can be cast to this struct (as a pointer)

func (Error) Error

func (e Error) Error() string

Error return a well human formatted message.

func (*Error) ErrorBody

func (e *Error) ErrorBody(body []byte)

ErrorBody add a body to an error

func (*Error) WithErrCode

func (e *Error) WithErrCode(err ErrCode, errs ...error) *Error

WithErrCode add an error code to an error

type Faceting

type Faceting struct {
	MaxValuesPerFacet int64 `json:"maxValuesPerFacet"`
}

Faceting is the type that represents the faceting setting in Meilisearch

func (Faceting) MarshalEasyJSON

func (v Faceting) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Faceting) MarshalJSON

func (v Faceting) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Faceting) UnmarshalEasyJSON

func (v *Faceting) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Faceting) UnmarshalJSON

func (v *Faceting) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Health

type Health struct {
	Status string `json:"status"`
}

Health is the request body for set Meilisearch health

func (Health) MarshalEasyJSON

func (v Health) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Health) MarshalJSON

func (v Health) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Health) UnmarshalEasyJSON

func (v *Health) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Health) UnmarshalJSON

func (v *Health) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Index

type Index struct {
	UID        string    `json:"uid"`
	CreatedAt  time.Time `json:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	PrimaryKey string    `json:"primaryKey,omitempty"`
	// contains filtered or unexported fields
}

Index is the type that represent an index in Meilisearch

func (Index) AddDocuments

func (i Index) AddDocuments(documentsPtr interface{}, primaryKey ...string) (resp *TaskInfo, err error)

func (Index) AddDocumentsCsv

func (i Index) AddDocumentsCsv(documents []byte, options *CsvDocumentsQuery) (resp *TaskInfo, err error)

func (Index) AddDocumentsCsvFromReader

func (i Index) AddDocumentsCsvFromReader(documents io.Reader, options *CsvDocumentsQuery) (resp *TaskInfo, err error)

func (Index) AddDocumentsCsvFromReaderInBatches

func (i Index) AddDocumentsCsvFromReaderInBatches(documents io.Reader, batchSize int, options *CsvDocumentsQuery) (resp []TaskInfo, err error)

func (Index) AddDocumentsCsvInBatches

func (i Index) AddDocumentsCsvInBatches(documents []byte, batchSize int, options *CsvDocumentsQuery) (resp []TaskInfo, err error)

func (Index) AddDocumentsInBatches

func (i Index) AddDocumentsInBatches(documentsPtr interface{}, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)

func (Index) AddDocumentsNdjson

func (i Index) AddDocumentsNdjson(documents []byte, primaryKey ...string) (resp *TaskInfo, err error)

func (Index) AddDocumentsNdjsonFromReader

func (i Index) AddDocumentsNdjsonFromReader(documents io.Reader, primaryKey ...string) (resp *TaskInfo, err error)

func (Index) AddDocumentsNdjsonFromReaderInBatches

func (i Index) AddDocumentsNdjsonFromReaderInBatches(documents io.Reader, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)

func (Index) AddDocumentsNdjsonInBatches

func (i Index) AddDocumentsNdjsonInBatches(documents []byte, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)

func (Index) Delete

func (i Index) Delete(uid string) (ok bool, err error)

func (Index) DeleteAllDocuments

func (i Index) DeleteAllDocuments() (resp *TaskInfo, err error)

func (Index) DeleteDocument

func (i Index) DeleteDocument(identifier string) (resp *TaskInfo, err error)

func (Index) DeleteDocuments

func (i Index) DeleteDocuments(identifier []string) (resp *TaskInfo, err error)

func (Index) DeleteDocumentsByFilter

func (i Index) DeleteDocumentsByFilter(filter interface{}) (resp *TaskInfo, err error)

func (*Index) FetchInfo

func (i *Index) FetchInfo() (resp *Index, err error)

func (Index) FetchPrimaryKey

func (i Index) FetchPrimaryKey() (resp *string, err error)

func (Index) GetDisplayedAttributes

func (i Index) GetDisplayedAttributes() (resp *[]string, err error)

func (Index) GetDistinctAttribute

func (i Index) GetDistinctAttribute() (resp *string, err error)

func (Index) GetDocument

func (i Index) GetDocument(identifier string, request *DocumentQuery, documentPtr interface{}) error

func (Index) GetDocuments

func (i Index) GetDocuments(request *DocumentsQuery, resp *DocumentsResult) error

func (Index) GetEmbedders

func (i Index) GetEmbedders() (resp map[string]Embedder, err error)

func (Index) GetFaceting

func (i Index) GetFaceting() (resp *Faceting, err error)

func (Index) GetFilterableAttributes

func (i Index) GetFilterableAttributes() (resp *[]string, err error)

func (Index) GetPagination

func (i Index) GetPagination() (resp *Pagination, err error)

func (Index) GetRankingRules

func (i Index) GetRankingRules() (resp *[]string, err error)

func (Index) GetSearchableAttributes

func (i Index) GetSearchableAttributes() (resp *[]string, err error)

func (Index) GetSettings

func (i Index) GetSettings() (resp *Settings, err error)

func (Index) GetSortableAttributes

func (i Index) GetSortableAttributes() (resp *[]string, err error)

func (Index) GetStats

func (i Index) GetStats() (resp *StatsIndex, err error)

func (Index) GetStopWords

func (i Index) GetStopWords() (resp *[]string, err error)

func (Index) GetSynonyms

func (i Index) GetSynonyms() (resp *map[string][]string, err error)

func (Index) GetTask

func (i Index) GetTask(taskUID int64) (resp *Task, err error)

func (Index) GetTasks

func (i Index) GetTasks(param *TasksQuery) (resp *TaskResult, err error)

func (Index) GetTypoTolerance

func (i Index) GetTypoTolerance() (resp *TypoTolerance, err error)

func (Index) MarshalEasyJSON

func (v Index) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Index) MarshalJSON

func (v Index) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Index) ResetDisplayedAttributes

func (i Index) ResetDisplayedAttributes() (resp *TaskInfo, err error)

func (Index) ResetDistinctAttribute

func (i Index) ResetDistinctAttribute() (resp *TaskInfo, err error)

func (Index) ResetEmbedders

func (i Index) ResetEmbedders() (resp *TaskInfo, err error)

func (Index) ResetFaceting

func (i Index) ResetFaceting() (resp *TaskInfo, err error)

func (Index) ResetFilterableAttributes

func (i Index) ResetFilterableAttributes() (resp *TaskInfo, err error)

func (Index) ResetPagination

func (i Index) ResetPagination() (resp *TaskInfo, err error)

func (Index) ResetRankingRules

func (i Index) ResetRankingRules() (resp *TaskInfo, err error)

func (Index) ResetSearchableAttributes

func (i Index) ResetSearchableAttributes() (resp *TaskInfo, err error)

func (Index) ResetSettings

func (i Index) ResetSettings() (resp *TaskInfo, err error)

func (Index) ResetSortableAttributes

func (i Index) ResetSortableAttributes() (resp *TaskInfo, err error)

func (Index) ResetStopWords

func (i Index) ResetStopWords() (resp *TaskInfo, err error)

func (Index) ResetSynonyms

func (i Index) ResetSynonyms() (resp *TaskInfo, err error)

func (Index) ResetTypoTolerance

func (i Index) ResetTypoTolerance() (resp *TaskInfo, err error)

func (Index) Search

func (i Index) Search(query string, request *SearchRequest) (*SearchResponse, error)

func (Index) SearchRaw

func (i Index) SearchRaw(query string, request *SearchRequest) (*json.RawMessage, error)

func (*Index) UnmarshalEasyJSON

func (v *Index) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Index) UnmarshalJSON

func (v *Index) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (Index) UpdateDisplayedAttributes

func (i Index) UpdateDisplayedAttributes(request *[]string) (resp *TaskInfo, err error)

func (Index) UpdateDistinctAttribute

func (i Index) UpdateDistinctAttribute(request string) (resp *TaskInfo, err error)

func (Index) UpdateDocuments

func (i Index) UpdateDocuments(documentsPtr interface{}, primaryKey ...string) (resp *TaskInfo, err error)

func (Index) UpdateDocumentsCsv

func (i Index) UpdateDocumentsCsv(documents []byte, options *CsvDocumentsQuery) (resp *TaskInfo, err error)

func (Index) UpdateDocumentsCsvFromReader

func (i Index) UpdateDocumentsCsvFromReader(documents io.Reader, options *CsvDocumentsQuery) (resp *TaskInfo, err error)

func (Index) UpdateDocumentsCsvFromReaderInBatches

func (i Index) UpdateDocumentsCsvFromReaderInBatches(documents io.Reader, batchSize int, options *CsvDocumentsQuery) (resp []TaskInfo, err error)

func (Index) UpdateDocumentsCsvInBatches

func (i Index) UpdateDocumentsCsvInBatches(documents []byte, batchSize int, options *CsvDocumentsQuery) (resp []TaskInfo, err error)

func (Index) UpdateDocumentsInBatches

func (i Index) UpdateDocumentsInBatches(documentsPtr interface{}, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)

func (Index) UpdateDocumentsNdjson

func (i Index) UpdateDocumentsNdjson(documents []byte, primaryKey ...string) (resp *TaskInfo, err error)

func (Index) UpdateDocumentsNdjsonFromReader

func (i Index) UpdateDocumentsNdjsonFromReader(documents io.Reader, primaryKey ...string) (resp *TaskInfo, err error)

func (Index) UpdateDocumentsNdjsonInBatches

func (i Index) UpdateDocumentsNdjsonInBatches(documents []byte, batchsize int, primaryKey ...string) (resp []TaskInfo, err error)

func (Index) UpdateEmbedders

func (i Index) UpdateEmbedders(request map[string]Embedder) (resp *TaskInfo, err error)

func (Index) UpdateFaceting

func (i Index) UpdateFaceting(request *Faceting) (resp *TaskInfo, err error)

func (Index) UpdateFilterableAttributes

func (i Index) UpdateFilterableAttributes(request *[]string) (resp *TaskInfo, err error)

func (*Index) UpdateIndex

func (i *Index) UpdateIndex(primaryKey string) (resp *TaskInfo, err error)

func (Index) UpdatePagination

func (i Index) UpdatePagination(request *Pagination) (resp *TaskInfo, err error)

func (Index) UpdateRankingRules

func (i Index) UpdateRankingRules(request *[]string) (resp *TaskInfo, err error)

func (Index) UpdateSearchableAttributes

func (i Index) UpdateSearchableAttributes(request *[]string) (resp *TaskInfo, err error)

func (Index) UpdateSettings

func (i Index) UpdateSettings(request *Settings) (resp *TaskInfo, err error)

func (Index) UpdateSortableAttributes

func (i Index) UpdateSortableAttributes(request *[]string) (resp *TaskInfo, err error)

func (Index) UpdateStopWords

func (i Index) UpdateStopWords(request *[]string) (resp *TaskInfo, err error)

func (Index) UpdateSynonyms

func (i Index) UpdateSynonyms(request *map[string][]string) (resp *TaskInfo, err error)

func (Index) UpdateTypoTolerance

func (i Index) UpdateTypoTolerance(request *TypoTolerance) (resp *TaskInfo, err error)

func (Index) WaitForTask

func (i Index) WaitForTask(taskUID int64, options ...WaitParams) (*Task, error)

WaitForTask waits for a task to be processed. The function will check by regular interval provided in parameter interval the TaskStatus. If no ctx and interval are provided WaitForTask will check each 50ms the status of a task.

type IndexConfig

type IndexConfig struct {

	// Uid is the unique identifier of a given index.
	Uid string

	// PrimaryKey is optional
	PrimaryKey string
	// contains filtered or unexported fields
}

IndexConfig configure the Index

type IndexInterface

type IndexInterface interface {
	FetchInfo() (resp *Index, err error)
	FetchPrimaryKey() (resp *string, err error)
	UpdateIndex(primaryKey string) (resp *TaskInfo, err error)
	Delete(uid string) (ok bool, err error)
	GetStats() (resp *StatsIndex, err error)

	AddDocuments(documentsPtr interface{}, primaryKey ...string) (resp *TaskInfo, err error)
	AddDocumentsInBatches(documentsPtr interface{}, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)
	AddDocumentsCsv(documents []byte, options *CsvDocumentsQuery) (resp *TaskInfo, err error)
	AddDocumentsCsvInBatches(documents []byte, batchSize int, options *CsvDocumentsQuery) (resp []TaskInfo, err error)
	AddDocumentsNdjson(documents []byte, primaryKey ...string) (resp *TaskInfo, err error)
	AddDocumentsNdjsonInBatches(documents []byte, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)
	UpdateDocuments(documentsPtr interface{}, primaryKey ...string) (resp *TaskInfo, err error)
	UpdateDocumentsInBatches(documentsPtr interface{}, batchSize int, primaryKey ...string) (resp []TaskInfo, err error)
	UpdateDocumentsCsv(documents []byte, options *CsvDocumentsQuery) (resp *TaskInfo, err error)
	UpdateDocumentsCsvInBatches(documents []byte, batchsize int, options *CsvDocumentsQuery) (resp []TaskInfo, err error)
	UpdateDocumentsNdjson(documents []byte, primaryKey ...string) (resp *TaskInfo, err error)
	UpdateDocumentsNdjsonInBatches(documents []byte, batchsize int, primaryKey ...string) (resp []TaskInfo, err error)
	GetDocument(uid string, request *DocumentQuery, documentPtr interface{}) error
	GetDocuments(param *DocumentsQuery, resp *DocumentsResult) error
	DeleteDocument(uid string) (resp *TaskInfo, err error)
	DeleteDocuments(uid []string) (resp *TaskInfo, err error)
	DeleteDocumentsByFilter(filter interface{}) (resp *TaskInfo, err error)
	DeleteAllDocuments() (resp *TaskInfo, err error)
	Search(query string, request *SearchRequest) (*SearchResponse, error)
	SearchRaw(query string, request *SearchRequest) (*json.RawMessage, error)

	GetTask(taskUID int64) (resp *Task, err error)
	GetTasks(param *TasksQuery) (resp *TaskResult, err error)

	GetSettings() (resp *Settings, err error)
	UpdateSettings(request *Settings) (resp *TaskInfo, err error)
	ResetSettings() (resp *TaskInfo, err error)
	GetRankingRules() (resp *[]string, err error)
	UpdateRankingRules(request *[]string) (resp *TaskInfo, err error)
	ResetRankingRules() (resp *TaskInfo, err error)
	GetDistinctAttribute() (resp *string, err error)
	UpdateDistinctAttribute(request string) (resp *TaskInfo, err error)
	ResetDistinctAttribute() (resp *TaskInfo, err error)
	GetSearchableAttributes() (resp *[]string, err error)
	UpdateSearchableAttributes(request *[]string) (resp *TaskInfo, err error)
	ResetSearchableAttributes() (resp *TaskInfo, err error)
	GetDisplayedAttributes() (resp *[]string, err error)
	UpdateDisplayedAttributes(request *[]string) (resp *TaskInfo, err error)
	ResetDisplayedAttributes() (resp *TaskInfo, err error)
	GetStopWords() (resp *[]string, err error)
	UpdateStopWords(request *[]string) (resp *TaskInfo, err error)
	ResetStopWords() (resp *TaskInfo, err error)
	GetSynonyms() (resp *map[string][]string, err error)
	UpdateSynonyms(request *map[string][]string) (resp *TaskInfo, err error)
	ResetSynonyms() (resp *TaskInfo, err error)
	GetFilterableAttributes() (resp *[]string, err error)
	UpdateFilterableAttributes(request *[]string) (resp *TaskInfo, err error)
	ResetFilterableAttributes() (resp *TaskInfo, err error)

	WaitForTask(taskUID int64, options ...WaitParams) (*Task, error)
}

type IndexesQuery

type IndexesQuery struct {
	Limit  int64
	Offset int64
}

func (IndexesQuery) MarshalEasyJSON

func (v IndexesQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (IndexesQuery) MarshalJSON

func (v IndexesQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*IndexesQuery) UnmarshalEasyJSON

func (v *IndexesQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*IndexesQuery) UnmarshalJSON

func (v *IndexesQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type IndexesResults

type IndexesResults struct {
	Results []Index `json:"results"`
	Offset  int64   `json:"offset"`
	Limit   int64   `json:"limit"`
	Total   int64   `json:"total"`
}

Return of multiple indexes is wrap in a IndexesResults

func (IndexesResults) MarshalEasyJSON

func (v IndexesResults) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (IndexesResults) MarshalJSON

func (v IndexesResults) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*IndexesResults) UnmarshalEasyJSON

func (v *IndexesResults) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*IndexesResults) UnmarshalJSON

func (v *IndexesResults) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Key

type Key struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Key         string    `json:"key,omitempty"`
	UID         string    `json:"uid,omitempty"`
	Actions     []string  `json:"actions,omitempty"`
	Indexes     []string  `json:"indexes,omitempty"`
	CreatedAt   time.Time `json:"createdAt,omitempty"`
	UpdatedAt   time.Time `json:"updatedAt,omitempty"`
	ExpiresAt   time.Time `json:"expiresAt"`
}

Keys allow the user to connect to the Meilisearch instance

Documentation: https://www.meilisearch.com/docs/learn/security/master_api_keys#protecting-a-meilisearch-instance

func (Key) MarshalEasyJSON

func (v Key) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Key) MarshalJSON

func (v Key) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Key) UnmarshalEasyJSON

func (v *Key) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Key) UnmarshalJSON

func (v *Key) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type KeyParsed

type KeyParsed struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	UID         string   `json:"uid,omitempty"`
	Actions     []string `json:"actions,omitempty"`
	Indexes     []string `json:"indexes,omitempty"`
	ExpiresAt   *string  `json:"expiresAt"`
}

This structure is used to send the exact ISO-8601 time format managed by Meilisearch

func (KeyParsed) MarshalEasyJSON

func (v KeyParsed) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (KeyParsed) MarshalJSON

func (v KeyParsed) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*KeyParsed) UnmarshalEasyJSON

func (v *KeyParsed) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*KeyParsed) UnmarshalJSON

func (v *KeyParsed) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type KeyUpdate

type KeyUpdate struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

This structure is used to update a Key

func (KeyUpdate) MarshalEasyJSON

func (v KeyUpdate) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (KeyUpdate) MarshalJSON

func (v KeyUpdate) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*KeyUpdate) UnmarshalEasyJSON

func (v *KeyUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*KeyUpdate) UnmarshalJSON

func (v *KeyUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type KeysQuery

type KeysQuery struct {
	Limit  int64
	Offset int64
}

func (KeysQuery) MarshalEasyJSON

func (v KeysQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (KeysQuery) MarshalJSON

func (v KeysQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*KeysQuery) UnmarshalEasyJSON

func (v *KeysQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*KeysQuery) UnmarshalJSON

func (v *KeysQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type KeysResults

type KeysResults struct {
	Results []Key `json:"results"`
	Offset  int64 `json:"offset"`
	Limit   int64 `json:"limit"`
	Total   int64 `json:"total"`
}

Return of multiple keys is wrap in a KeysResults

func (KeysResults) MarshalEasyJSON

func (v KeysResults) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (KeysResults) MarshalJSON

func (v KeysResults) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*KeysResults) UnmarshalEasyJSON

func (v *KeysResults) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*KeysResults) UnmarshalJSON

func (v *KeysResults) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type MinWordSizeForTypos

type MinWordSizeForTypos struct {
	OneTypo  int64 `json:"oneTypo,omitempty"`
	TwoTypos int64 `json:"twoTypos,omitempty"`
}

MinWordSizeForTypos is the type that represents the minWordSizeForTypos setting in the typo tolerance setting in Meilisearch

func (MinWordSizeForTypos) MarshalEasyJSON

func (v MinWordSizeForTypos) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (MinWordSizeForTypos) MarshalJSON

func (v MinWordSizeForTypos) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*MinWordSizeForTypos) UnmarshalEasyJSON

func (v *MinWordSizeForTypos) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*MinWordSizeForTypos) UnmarshalJSON

func (v *MinWordSizeForTypos) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type MultiSearchRequest

type MultiSearchRequest struct {
	Queries []SearchRequest `json:"queries"`
}

func (MultiSearchRequest) MarshalEasyJSON

func (v MultiSearchRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (MultiSearchRequest) MarshalJSON

func (v MultiSearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*MultiSearchRequest) UnmarshalEasyJSON

func (v *MultiSearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*MultiSearchRequest) UnmarshalJSON

func (v *MultiSearchRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type MultiSearchResponse

type MultiSearchResponse struct {
	Results []SearchResponse `json:"results"`
}

func (MultiSearchResponse) MarshalEasyJSON

func (v MultiSearchResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (MultiSearchResponse) MarshalJSON

func (v MultiSearchResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*MultiSearchResponse) UnmarshalEasyJSON

func (v *MultiSearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*MultiSearchResponse) UnmarshalJSON

func (v *MultiSearchResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Pagination

type Pagination struct {
	MaxTotalHits int64 `json:"maxTotalHits"`
}

Pagination is the type that represents the pagination setting in Meilisearch

func (Pagination) MarshalEasyJSON

func (v Pagination) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Pagination) MarshalJSON

func (v Pagination) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Pagination) UnmarshalEasyJSON

func (v *Pagination) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Pagination) UnmarshalJSON

func (v *Pagination) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RawType

type RawType []byte

RawType is an alias for raw byte[]

func (RawType) MarshalJSON

func (b RawType) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*RawType) UnmarshalJSON

func (b *RawType) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SearchRequest

type SearchRequest struct {
	Offset                  int64
	Limit                   int64
	AttributesToRetrieve    []string
	AttributesToSearchOn    []string
	AttributesToCrop        []string
	CropLength              int64
	CropMarker              string
	AttributesToHighlight   []string
	HighlightPreTag         string
	HighlightPostTag        string
	MatchingStrategy        string
	Filter                  interface{}
	ShowMatchesPosition     bool
	ShowRankingScore        bool
	ShowRankingScoreDetails bool
	Facets                  []string
	PlaceholderSearch       bool
	Sort                    []string
	Vector                  []float32
	HitsPerPage             int64
	Page                    int64
	IndexUID                string
	Query                   string
	Hybrid                  *SearchRequestHybrid
}

SearchRequest is the request url param needed for a search query. This struct will be converted to url param before sent.

Documentation: https://www.meilisearch.com/docs/reference/api/search#search-parameters

func (SearchRequest) MarshalEasyJSON

func (v SearchRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SearchRequest) MarshalJSON

func (v SearchRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SearchRequest) UnmarshalEasyJSON

func (v *SearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SearchRequest) UnmarshalJSON

func (v *SearchRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SearchRequestHybrid

type SearchRequestHybrid struct {
	SemanticRatio float64
	Embedder      string
}

func (SearchRequestHybrid) MarshalEasyJSON

func (v SearchRequestHybrid) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SearchRequestHybrid) MarshalJSON

func (v SearchRequestHybrid) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SearchRequestHybrid) UnmarshalEasyJSON

func (v *SearchRequestHybrid) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SearchRequestHybrid) UnmarshalJSON

func (v *SearchRequestHybrid) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SearchResponse

type SearchResponse struct {
	Hits               []interface{} `json:"hits"`
	EstimatedTotalHits int64         `json:"estimatedTotalHits,omitempty"`
	Offset             int64         `json:"offset,omitempty"`
	Limit              int64         `json:"limit,omitempty"`
	ProcessingTimeMs   int64         `json:"processingTimeMs"`
	Query              string        `json:"query"`
	FacetDistribution  interface{}   `json:"facetDistribution,omitempty"`
	TotalHits          int64         `json:"totalHits,omitempty"`
	HitsPerPage        int64         `json:"hitsPerPage,omitempty"`
	Page               int64         `json:"page,omitempty"`
	TotalPages         int64         `json:"totalPages,omitempty"`
	FacetStats         interface{}   `json:"facetStats,omitempty"`
	IndexUID           string        `json:"indexUid,omitempty"`
}

SearchResponse is the response body for search method

func (SearchResponse) MarshalEasyJSON

func (v SearchResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SearchResponse) MarshalJSON

func (v SearchResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SearchResponse) UnmarshalEasyJSON

func (v *SearchResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SearchResponse) UnmarshalJSON

func (v *SearchResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Settings

type Settings struct {
	RankingRules         []string            `json:"rankingRules,omitempty"`
	DistinctAttribute    *string             `json:"distinctAttribute,omitempty"`
	SearchableAttributes []string            `json:"searchableAttributes,omitempty"`
	DisplayedAttributes  []string            `json:"displayedAttributes,omitempty"`
	StopWords            []string            `json:"stopWords,omitempty"`
	Synonyms             map[string][]string `json:"synonyms,omitempty"`
	FilterableAttributes []string            `json:"filterableAttributes,omitempty"`
	SortableAttributes   []string            `json:"sortableAttributes,omitempty"`
	TypoTolerance        *TypoTolerance      `json:"typoTolerance,omitempty"`
	Pagination           *Pagination         `json:"pagination,omitempty"`
	Faceting             *Faceting           `json:"faceting,omitempty"`
	Embedders            map[string]Embedder `json:"embedders,omitempty"`
}

Settings is the type that represents the settings in Meilisearch

func (Settings) MarshalEasyJSON

func (v Settings) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Settings) MarshalJSON

func (v Settings) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Settings) UnmarshalEasyJSON

func (v *Settings) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Settings) UnmarshalJSON

func (v *Settings) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Stats

type Stats struct {
	DatabaseSize int64                 `json:"databaseSize"`
	LastUpdate   time.Time             `json:"lastUpdate"`
	Indexes      map[string]StatsIndex `json:"indexes"`
}

Stats is the type that represent all stats

func (Stats) MarshalEasyJSON

func (v Stats) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Stats) MarshalJSON

func (v Stats) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Stats) UnmarshalEasyJSON

func (v *Stats) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Stats) UnmarshalJSON

func (v *Stats) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type StatsIndex

type StatsIndex struct {
	NumberOfDocuments int64            `json:"numberOfDocuments"`
	IsIndexing        bool             `json:"isIndexing"`
	FieldDistribution map[string]int64 `json:"fieldDistribution"`
}

StatsIndex is the type that represent the stats of an index in Meilisearch

func (StatsIndex) MarshalEasyJSON

func (v StatsIndex) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (StatsIndex) MarshalJSON

func (v StatsIndex) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*StatsIndex) UnmarshalEasyJSON

func (v *StatsIndex) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*StatsIndex) UnmarshalJSON

func (v *StatsIndex) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SwapIndexesParams

type SwapIndexesParams struct {
	Indexes []string `json:"indexes"`
}

func (SwapIndexesParams) MarshalEasyJSON

func (v SwapIndexesParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SwapIndexesParams) MarshalJSON

func (v SwapIndexesParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SwapIndexesParams) UnmarshalEasyJSON

func (v *SwapIndexesParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SwapIndexesParams) UnmarshalJSON

func (v *SwapIndexesParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Task

type Task struct {
	Status     TaskStatus          `json:"status"`
	UID        int64               `json:"uid,omitempty"`
	TaskUID    int64               `json:"taskUid,omitempty"`
	IndexUID   string              `json:"indexUid"`
	Type       TaskType            `json:"type"`
	Error      meilisearchApiError `json:"error,omitempty"`
	Duration   string              `json:"duration,omitempty"`
	EnqueuedAt time.Time           `json:"enqueuedAt"`
	StartedAt  time.Time           `json:"startedAt,omitempty"`
	FinishedAt time.Time           `json:"finishedAt,omitempty"`
	Details    Details             `json:"details,omitempty"`
	CanceledBy int64               `json:"canceledBy,omitempty"`
}

Task indicates information about a task resource

Documentation: https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations

func (Task) MarshalEasyJSON

func (v Task) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Task) MarshalJSON

func (v Task) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Task) UnmarshalEasyJSON

func (v *Task) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Task) UnmarshalJSON

func (v *Task) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TaskInfo

type TaskInfo struct {
	Status     TaskStatus `json:"status"`
	TaskUID    int64      `json:"taskUid"`
	IndexUID   string     `json:"indexUid"`
	Type       TaskType   `json:"type"`
	EnqueuedAt time.Time  `json:"enqueuedAt"`
}

TaskInfo indicates information regarding a task returned by an asynchronous method

Documentation: https://www.meilisearch.com/docs/reference/api/tasks#tasks

func (TaskInfo) MarshalEasyJSON

func (v TaskInfo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TaskInfo) MarshalJSON

func (v TaskInfo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TaskInfo) UnmarshalEasyJSON

func (v *TaskInfo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TaskInfo) UnmarshalJSON

func (v *TaskInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TaskResult

type TaskResult struct {
	Results []Task `json:"results"`
	Limit   int64  `json:"limit"`
	From    int64  `json:"from"`
	Next    int64  `json:"next"`
	Total   int64  `json:"total"`
}

Return of multiple tasks is wrap in a TaskResult

func (TaskResult) MarshalEasyJSON

func (v TaskResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TaskResult) MarshalJSON

func (v TaskResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TaskResult) UnmarshalEasyJSON

func (v *TaskResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TaskResult) UnmarshalJSON

func (v *TaskResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TaskStatus

type TaskStatus string

TaskStatus is the status of a task.

const (
	// TaskStatusUnknown is the default TaskStatus, should not exist
	TaskStatusUnknown TaskStatus = "unknown"
	// TaskStatusEnqueued the task request has been received and will be processed soon
	TaskStatusEnqueued TaskStatus = "enqueued"
	// TaskStatusProcessing the task is being processed
	TaskStatusProcessing TaskStatus = "processing"
	// TaskStatusSucceeded the task has been successfully processed
	TaskStatusSucceeded TaskStatus = "succeeded"
	// TaskStatusFailed a failure occurred when processing the task, no changes were made to the database
	TaskStatusFailed TaskStatus = "failed"
	// TaskStatusCanceled the task was canceled
	TaskStatusCanceled TaskStatus = "canceled"
)

type TaskType

type TaskType string

TaskType is the type of a task

const (
	// TaskTypeIndexCreation represents an index creation
	TaskTypeIndexCreation TaskType = "indexCreation"
	// TaskTypeIndexUpdate represents an index update
	TaskTypeIndexUpdate TaskType = "indexUpdate"
	// TaskTypeIndexDeletion represents an index deletion
	TaskTypeIndexDeletion TaskType = "indexDeletion"
	// TaskTypeIndexSwap represents an index swap
	TaskTypeIndexSwap TaskType = "indexSwap"
	// TaskTypeDocumentAdditionOrUpdate represents a document addition or update in an index
	TaskTypeDocumentAdditionOrUpdate TaskType = "documentAdditionOrUpdate"
	// TaskTypeDocumentDeletion represents a document deletion from an index
	TaskTypeDocumentDeletion TaskType = "documentDeletion"
	// TaskTypeSettingsUpdate represents a settings update
	TaskTypeSettingsUpdate TaskType = "settingsUpdate"
	// TaskTypeDumpCreation represents a dump creation
	TaskTypeDumpCreation TaskType = "dumpCreation"
	// TaskTypeTaskCancelation represents a task cancelation
	TaskTypeTaskCancelation TaskType = "taskCancelation"
	// TaskTypeTaskDeletion represents a task deletion
	TaskTypeTaskDeletion TaskType = "taskDeletion"
	// TaskTypeSnapshotCreation represents a snapshot creation
	TaskTypeSnapshotCreation TaskType = "snapshotCreation"
)

type TasksQuery

type TasksQuery struct {
	UIDS             []int64
	Limit            int64
	From             int64
	IndexUIDS        []string
	Statuses         []TaskStatus
	Types            []TaskType
	CanceledBy       []int64
	BeforeEnqueuedAt time.Time
	AfterEnqueuedAt  time.Time
	BeforeStartedAt  time.Time
	AfterStartedAt   time.Time
	BeforeFinishedAt time.Time
	AfterFinishedAt  time.Time
}

TasksQuery is a list of filter available to send as query parameters

func (TasksQuery) MarshalEasyJSON

func (v TasksQuery) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TasksQuery) MarshalJSON

func (v TasksQuery) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TasksQuery) UnmarshalEasyJSON

func (v *TasksQuery) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TasksQuery) UnmarshalJSON

func (v *TasksQuery) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TenantTokenClaims

type TenantTokenClaims struct {
	APIKeyUID   string      `json:"apiKeyUid"`
	SearchRules interface{} `json:"searchRules"`
	jwt.RegisteredClaims
}

Custom Claims structure to create a Tenant Token

func (TenantTokenClaims) MarshalEasyJSON

func (v TenantTokenClaims) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TenantTokenClaims) MarshalJSON

func (v TenantTokenClaims) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TenantTokenClaims) UnmarshalEasyJSON

func (v *TenantTokenClaims) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TenantTokenClaims) UnmarshalJSON

func (v *TenantTokenClaims) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TenantTokenOptions

type TenantTokenOptions struct {
	APIKey    string
	ExpiresAt time.Time
}

Information to create a tenant token

ExpiresAt is a time.Time when the key will expire. Note that if an ExpiresAt value is included it should be in UTC time. ApiKey is the API key parent of the token.

func (TenantTokenOptions) MarshalEasyJSON

func (v TenantTokenOptions) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TenantTokenOptions) MarshalJSON

func (v TenantTokenOptions) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TenantTokenOptions) UnmarshalEasyJSON

func (v *TenantTokenOptions) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TenantTokenOptions) UnmarshalJSON

func (v *TenantTokenOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type TypoTolerance

type TypoTolerance struct {
	Enabled             bool                `json:"enabled,omitempty"`
	MinWordSizeForTypos MinWordSizeForTypos `json:"minWordSizeForTypos,omitempty"`
	DisableOnWords      []string            `json:"disableOnWords,omitempty"`
	DisableOnAttributes []string            `json:"disableOnAttributes,omitempty"`
}

TypoTolerance is the type that represents the typo tolerance setting in Meilisearch

func (TypoTolerance) MarshalEasyJSON

func (v TypoTolerance) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (TypoTolerance) MarshalJSON

func (v TypoTolerance) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*TypoTolerance) UnmarshalEasyJSON

func (v *TypoTolerance) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*TypoTolerance) UnmarshalJSON

func (v *TypoTolerance) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Unknown

type Unknown map[string]interface{}

Unknown is unknown json type

type UpdateIndexRequest

type UpdateIndexRequest struct {
	PrimaryKey string `json:"primaryKey"`
}

UpdateIndexRequest is the request body for update Index primary key

func (UpdateIndexRequest) MarshalEasyJSON

func (v UpdateIndexRequest) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UpdateIndexRequest) MarshalJSON

func (v UpdateIndexRequest) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UpdateIndexRequest) UnmarshalEasyJSON

func (v *UpdateIndexRequest) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UpdateIndexRequest) UnmarshalJSON

func (v *UpdateIndexRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Version

type Version struct {
	CommitSha  string `json:"commitSha"`
	CommitDate string `json:"commitDate"`
	PkgVersion string `json:"pkgVersion"`
}

Version is the type that represents the versions in Meilisearch

func (Version) MarshalEasyJSON

func (v Version) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Version) MarshalJSON

func (v Version) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Version) UnmarshalEasyJSON

func (v *Version) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Version) UnmarshalJSON

func (v *Version) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type WaitParams

type WaitParams struct {
	Context  context.Context
	Interval time.Duration
}

Jump to

Keyboard shortcuts

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