loop

package
v0.0.0-...-9f20ba0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateListElements

func CreateListElements(result VenddyResult) map[string]ldk.WhisperContentListElement

func Serve

func Serve() error

Serve creates the new loop and tells the LDK to serve it

Types

type Loop

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

Loop is a structure for generating SideKick whispers

func NewLoop

func NewLoop(logger *ldk.Logger) (*Loop, error)

NewLoop returns a pointer to a loop

func (*Loop) CreateDisambiguationElements

func (l *Loop) CreateDisambiguationElements(response VenddyResponse, text string) map[string]ldk.WhisperContentDisambiguationElement

func (*Loop) CreateForm

func (l *Loop) CreateForm(text string)

func (*Loop) GetVenddyCategoryNames

func (l *Loop) GetVenddyCategoryNames(results []VenddyResult) []VenddyResult

func (*Loop) GetVenddyClassNames

func (l *Loop) GetVenddyClassNames(results []VenddyResult) []VenddyResult

func (*Loop) GetVenddySubcategoryNames

func (l *Loop) GetVenddySubcategoryNames(results []VenddyResult) []VenddyResult

func (*Loop) GetVenddyTypeNames

func (l *Loop) GetVenddyTypeNames(results []VenddyResult) []VenddyResult

func (*Loop) GetVendorSearch

func (l *Loop) GetVendorSearch(vendor string, max int, startAt int) *ldk.HTTPResponse

func (*Loop) LoopStart

func (l *Loop) LoopStart(sidekick ldk.Sidekick) error

LoopStart is called by the host when the loop is started to provide access to the host process

func (*Loop) LoopStop

func (l *Loop) LoopStop() error

LoopStop is called by the host when the loop is stopped

type Venddy

type Venddy struct {
	Response VenddyResponse `json:"response"`
}

type VenddyResponse

type VenddyResponse struct {
	Results   []VenddyResult `json:"results"`
	Cursor    int            `json:"Cursor"`
	Remaining int            `json:"Remaining"`
	Count     int            `json:"Count"`
}

type VenddyResult

type VenddyResult struct {
	Id               string   `json:"_id"`
	Website          string   `json:"Website"`
	Description      string   `json:"Description"`
	Name             string   `json:"Name"`
	Keywords         string   `json:"Search field"`
	Categories       []string `json:"Categories"`
	CategoryNames    string
	Classes          []string `json:"Classes"`
	ClassNames       string
	Subcategories    []string `json:"Subcategories"`
	SubcategoryNames string
	Types            []string `json:"Types"`
	TypeNames        string
	Score            float64 `json:"Score"`
	ReviewCount      float64 `json:"Number of Reviews"`
}

Jump to

Keyboard shortcuts

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