search

package
v0.0.0-...-4fdfd55 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ApplicationID    string
	AlgoliaAPIKey    string
	AlgoliaSearchKey string
	IndexName        string
}

Config provides the configuration required by the search package.

func NewConfig

func NewConfig() Config

NewConfig returns a new instance of Config.

func (Config) Validate

func (c Config) Validate() error

Validate returns an error if the config is invalid.

type IndexedChannel

type IndexedChannel struct {
	ObjectID string `json:"objectID"`

	Name string `json:"name"`
}

IndexedUser is

ObjectID is used to unique identify objects in Algolia.

func NewIndexedChannel

func NewIndexedChannel(m *model.Channel) *IndexedChannel

NewIndexedUser returns a new instance of IndexedUser by copying over relevant fields.

type IndexedUser

type IndexedUser struct {
	ObjectID string `json:"objectID"`

	DisplayName      string `json:"displayName"`
	FirstName        string `json:"firstName"`
	LastName         string `json:"lastName"`
	Username         string `json:"username"`
	ProfileImagePath string `json:"profileImagePath"`
	CoverImagePath   string `json:"coverImagePath"`
	Bio              string `json:"bio"`
}

IndexedUser is

ObjectID is used to unique identify objects in Algolia.

func NewIndexedUser

func NewIndexedUser(m *model.User) *IndexedUser

NewIndexedUser returns a new instance of IndexedUser by copying over relevant fields.

type Indexer

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

Indexer is used to index cards into a search engine.

func NewIndexer

func NewIndexer(s *store.Store, l log.Logger, cfg *Config) (*Indexer, error)

Indexer returns a new instance of Indexer.

func (*Indexer) IndexAll

func (i *Indexer) IndexAll(clearFirst bool) error

func (*Indexer) IndexAllChannels

func (i *Indexer) IndexAllChannels(clearFirst bool) error

func (*Indexer) IndexAllUsers

func (i *Indexer) IndexAllUsers(clearFirst bool) error

func (*Indexer) IndexChannel

func (i *Indexer) IndexChannel(m *model.Channel) error

UpdateIndex updates the index for a given card by making sure all added viewers will be available on the index for the given card.

func (*Indexer) IndexChannels

func (i *Indexer) IndexChannels(channels []*model.Channel) error

UpdateIndex updates the index for a given card by making sure all added viewers will be available on the index for the given card.

func (*Indexer) IndexUser

func (i *Indexer) IndexUser(m *model.User) error

func (*Indexer) IndexUsers

func (i *Indexer) IndexUsers(users []*model.User) error

UpdateIndex updates the index for a given card by making sure all added viewers will be available on the index for the given card.

func (*Indexer) RemoveIndexForChannel

func (i *Indexer) RemoveIndexForChannel(m *model.Channel) error

UpdateIndex updates the index for a given card by making sure all added viewers will be available on the index for the given card.

func (*Indexer) RemoveIndexForUser

func (i *Indexer) RemoveIndexForUser(m *model.User) error

UpdateIndex updates the index for a given card by making sure all added viewers will be available on the index for the given card.

Jump to

Keyboard shortcuts

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