searchbot

package
v0.0.0-...-98e5a49 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAssemblyingRequest = errors.New("Error assemblying http request")
View Source
var ErrDecodingSwagger = errors.New("Error decoding swagger.json")
View Source
var ErrHttpStatusFetchingSwagger = errors.New("Error HTTP status fetching swagger.json")
View Source
var ErrMarshalingRequestBody = errors.New("Error marshaling request body")
View Source
var ErrQueryingSearchBot = errors.New("Error querying search bot")
View Source
var ErrReadingResponseBody = errors.New("Error reading response body")
View Source
var ErrTmoutFetchingSwagger = errors.New("Error timeout fetching swagger.json")
View Source
var ErrUndefinedField = errors.New("Error undefined field")
View Source
var ErrUnmarshalingRequestBody = errors.New("Error unmarshaling request body")

Functions

func HasSearchTag

func HasSearchTag(tags []string) bool

Types

type BotClientsT

type BotClientsT masterbot.BotClientsT

type ProviderT

type ProviderT struct {
	Bot        *masterbot.BotClientT
	BotId      string
	Path       string                        // Restful path of the service
	HttpMethod string                        // GET, POST, PUT, DELETE, etc.
	Operation  stonelizard.SwaggerOperationT // Service specification details
	Requires   *intsets.Sparse               // Input parameters (set of Taxonomy entries)
	Provides   *intsets.Sparse               // Return values (set of Taxonomy entries)
}

Provider is a search operation. Bots may offer more than 1 provider

type ResponseFieldT

type ResponseFieldT struct {
	Value  interface{}
	Source string
	DtUpd  string
}

type SearchBotT

type SearchBotT struct {
	sync.RWMutex
	Providers         []ProviderT
	Taxonomy          TaxonomyTreeT           // List of all known data provided/required by the bots
	ByProvision       map[int]*intsets.Sparse // Index of bots by which data they provide
	ByRequirement     map[int]*intsets.Sparse // Index of bots by which data they require
	Config            *masterbot.ConfigT
	HttpsSearchClient *http.Client
	// contains filtered or unexported fields
}

func New

func New(cfg *masterbot.ConfigT) (*SearchBotT, error)

func (SearchBotT) GetConfig

func (sb SearchBotT) GetConfig() (stonelizard.Shaper, error)

func (*SearchBotT) Search

func (sb *SearchBotT) Search(searchBy map[string]string, searchFor []string, login string, password string, tid string) stonelizard.Response

func (*SearchBotT) TaxonomyDump

func (sb *SearchBotT) TaxonomyDump(tid string) stonelizard.Response

type SearchbotG

type SearchbotG struct {
	Search   goose.Alert `json:"Search"`
	Taxonomy goose.Alert `json:"Taxonomy"`
}
var Goose SearchbotG

type TaxonomyTreeT

type TaxonomyTreeT struct {
	Rune rune
	Id   int // In the root, this is actually the next available id
	Next []*TaxonomyTreeT
}

func (*TaxonomyTreeT) Add

func (t *TaxonomyTreeT) Add(item string) int

func (*TaxonomyTreeT) Search

func (t *TaxonomyTreeT) Search(item string) (int, *TaxonomyTreeT, *TaxonomyTreeT)

func (TaxonomyTreeT) String

func (t TaxonomyTreeT) String() string

Jump to

Keyboard shortcuts

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