Documentation ¶
Index ¶
- Variables
- func NewMeiliClient(conf config.Config) (store.DocStoreInterface, error)
- type AttrQuery
- type Client
- func (c *Client) CreateDocument(ctx context.Context, doc *doc.Document) error
- func (c *Client) DeleteDocument(ctx context.Context, entryId int64) error
- func (c *Client) FilterDocuments(ctx context.Context, filter *doc.DocumentFilter) ([]*doc.Document, error)
- func (c *Client) GetDocument(ctx context.Context, entryId int64) (*doc.Document, error)
- func (c *Client) UpdateDocument(ctx context.Context, doc *doc.Document) error
- type DocPtrInterface
- type Document
- type DocumentAttr
- type DocumentAttrList
- type DocumentAttrQueries
- type DocumentAttrQuery
- func (q *DocumentAttrQuery) FromModel(doc *doc.Document) *DocumentAttrQuery
- func (q *DocumentAttrQuery) OfEntryId(namespace, entryId string) *DocumentAttrQuery
- func (q *DocumentAttrQuery) String() string
- func (q *DocumentAttrQuery) ToFilter() interface{}
- func (q *DocumentAttrQuery) ToRequest() *meilisearch.SearchRequest
- type DocumentList
- type DocumentQuery
- func (q *DocumentQuery) FromModel(query *doc.DocumentFilter) *DocumentQuery
- func (q *DocumentQuery) OfEntryId(namespace string, entryId int64) *DocumentQuery
- func (q *DocumentQuery) String() string
- func (q *DocumentQuery) ToFilter() interface{}
- func (q *DocumentQuery) ToRequest() *meilisearch.SearchRequest
- type MockClient
- func (m *MockClient) CreateDocument(ctx context.Context, doc *doc.Document) error
- func (m *MockClient) DeleteDocument(ctx context.Context, docId int64) error
- func (m *MockClient) FilterDocuments(ctx context.Context, filter *doc.DocumentFilter) ([]*doc.Document, error)
- func (m *MockClient) GetDocument(ctx context.Context, entryId int64) (*doc.Document, error)
- func (m *MockClient) UpdateDocument(ctx context.Context, doc *doc.Document) error
- type Sort
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DocFilterableAttrs = []string{"namespace", "id", "entryId", "kind", "name", "source", "webUrl", "createdAt", "updatedAt"} DocSortAttrs = []string{"createdAt", "updatedAt", "name"} DocAttrFilterableAttrs = []string{"namespace", "entryId", "key", "id", "kind", "value"} DocAttrSortAttrs = []string{"createdAt", "updatedAt"} )
Functions ¶
func NewMeiliClient ¶
func NewMeiliClient(conf config.Config) (store.DocStoreInterface, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateDocument ¶
func (*Client) DeleteDocument ¶
func (*Client) FilterDocuments ¶
func (*Client) GetDocument ¶
type DocPtrInterface ¶
type Document ¶
type Document struct { Id string `json:"id"` Kind string `json:"kind"` Namespace string `json:"namespace"` EntryId string `json:"entryId"` Name string `json:"name"` Source string `json:"source,omitempty"` WebUrl string `json:"webUrl,omitempty"` Content string `json:"content"` Summary string `json:"summary,omitempty"` HeaderImage string `json:"headerImage,omitempty"` SubContent string `json:"subContent,omitempty"` CreatedAt int64 `json:"createdAt,omitempty"` UpdatedAt int64 `json:"updatedAt,omitempty"` }
type DocumentAttr ¶
type DocumentAttr struct { Id string `json:"id"` Kind string `json:"kind"` Namespace string `json:"namespace"` EntryId string `json:"entryId"` Key string `json:"key"` Value interface{} `json:"value"` }
func (*DocumentAttr) EntryID ¶
func (d *DocumentAttr) EntryID() string
func (*DocumentAttr) ID ¶
func (d *DocumentAttr) ID() string
func (*DocumentAttr) NewTest ¶
func (d *DocumentAttr) NewTest() *DocumentAttr
func (*DocumentAttr) String ¶
func (d *DocumentAttr) String() string
func (*DocumentAttr) Type ¶
func (d *DocumentAttr) Type() string
type DocumentAttrList ¶
type DocumentAttrList []*DocumentAttr
func (*DocumentAttrList) FromModel ¶
func (d *DocumentAttrList) FromModel(doc *doc.Document) *DocumentAttrList
func (*DocumentAttrList) String ¶
func (d *DocumentAttrList) String() string
type DocumentAttrQueries ¶
type DocumentAttrQueries []*DocumentAttrQuery
func (*DocumentAttrQueries) FromFilter ¶
func (q *DocumentAttrQueries) FromFilter(query *doc.DocumentFilter) *DocumentAttrQueries
func (*DocumentAttrQueries) String ¶
func (q *DocumentAttrQueries) String() string
type DocumentAttrQuery ¶
type DocumentAttrQuery struct {
AttrQueries []*AttrQuery
}
func (*DocumentAttrQuery) FromModel ¶
func (q *DocumentAttrQuery) FromModel(doc *doc.Document) *DocumentAttrQuery
func (*DocumentAttrQuery) OfEntryId ¶
func (q *DocumentAttrQuery) OfEntryId(namespace, entryId string) *DocumentAttrQuery
func (*DocumentAttrQuery) String ¶
func (q *DocumentAttrQuery) String() string
func (*DocumentAttrQuery) ToFilter ¶
func (q *DocumentAttrQuery) ToFilter() interface{}
func (*DocumentAttrQuery) ToRequest ¶
func (q *DocumentAttrQuery) ToRequest() *meilisearch.SearchRequest
type DocumentList ¶
type DocumentList []*Document
func (DocumentList) String ¶
func (d DocumentList) String() string
type DocumentQuery ¶
type DocumentQuery struct { AttrQueries []*AttrQuery Search string HitsPerPage int64 Page int64 Offset int64 Limit int64 Sort []Sort }
func (*DocumentQuery) FromModel ¶
func (q *DocumentQuery) FromModel(query *doc.DocumentFilter) *DocumentQuery
func (*DocumentQuery) OfEntryId ¶
func (q *DocumentQuery) OfEntryId(namespace string, entryId int64) *DocumentQuery
func (*DocumentQuery) String ¶
func (q *DocumentQuery) String() string
func (*DocumentQuery) ToFilter ¶
func (q *DocumentQuery) ToFilter() interface{}
func (*DocumentQuery) ToRequest ¶
func (q *DocumentQuery) ToRequest() *meilisearch.SearchRequest
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
func (*MockClient) CreateDocument ¶
func (*MockClient) DeleteDocument ¶
func (m *MockClient) DeleteDocument(ctx context.Context, docId int64) error
func (*MockClient) FilterDocuments ¶
func (m *MockClient) FilterDocuments(ctx context.Context, filter *doc.DocumentFilter) ([]*doc.Document, error)
func (*MockClient) GetDocument ¶
func (*MockClient) UpdateDocument ¶
Click to show internal directories.
Click to hide internal directories.