algolia

package
v0.0.0-...-bf83fb3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECode050101 = e.Code0501 + "01"
	ECode050102 = e.Code0501 + "02"
	ECode050103 = e.Code0501 + "03"
	ECode050104 = e.Code0501 + "04"
	ECode050105 = e.Code0501 + "05"
	ECode050106 = e.Code0501 + "06"
)
View Source
const (
	MaxGoroutines        = 1000 // The maximum allowed number of go routines
	DefaultNumGoRoutines = 25
)
View Source
const (
	ECode050201 = e.Code0502 + "01"
	ECode050202 = e.Code0502 + "02"
	ECode050203 = e.Code0502 + "03"
	ECode050204 = e.Code0502 + "04"
)
View Source
const (
	MIGRATION_CODE = "algolia"
)

Variables

This section is empty.

Functions

func GetMigrationList

func GetMigrationList() (ml *migration.List)

GetMigrationList returns this packages migration list

Types

type Algolia

type Algolia struct {
	Client *search.Client
	Index  *search.Index
	// contains filtered or unexported fields
}

Algolia handler for pushing index updates to Algolia

func NewAlgolia

func NewAlgolia(config *model.AlgoliaConfig) (alg *Algolia, err error)

NewAlgolia initialize a new algolia client/index

func (*Algolia) Delete

func (alg *Algolia) Delete(objectID string) (err error)

Delete deletes an item from the specified Algolia Index

func (*Algolia) DeleteBy

func (alg *Algolia) DeleteBy(opt ...interface{}) (res search.UpdateTaskRes, err error)

DeleteBy deletes records based on the options, must be valid algolia delete by options. If wait is true, it will wait for the task to complete

func (*Algolia) Push

func (alg *Algolia) Push(item interface{}) (err error)

Push saves an item to the specified Algolia Index

func (*Algolia) Sync

func (alg *Algolia) Sync(db *sql.Connection, f func(*sql.Connection, *model.AlgoliaSync) error) (err error)

Sync attempts to send all 'pending' and 'failed' records to algolia

func (*Algolia) SyncItem

func (alg *Algolia) SyncItem(db *sql.Connection, item *model.AlgoliaSync) (err error)

syncItem sync an item to algolia

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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