qaengine

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCaches

func AddCaches(cacheFiles []string)

AddCaches adds cache responders

func FetchAnswer

func FetchAnswer(prob qatypes.Problem) (ans qatypes.Problem, err error)

FetchAnswer fetches the answer for the question

func SetWriteCache

func SetWriteCache(cacheFile string) error

SetWriteCache sets the write cache

func StartEngine

func StartEngine(qaskip bool, qaport int, qadisablecli bool)

StartEngine starts the QA Engines

Types

type CacheEngine

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

CacheEngine handles cache

func (*CacheEngine) FetchAnswer

func (c *CacheEngine) FetchAnswer(prob qatypes.Problem) (ans qatypes.Problem, err error)

FetchAnswer fetches the answer using cache

func (*CacheEngine) StartEngine

func (c *CacheEngine) StartEngine() error

StartEngine starts the cache engine

type CliEngine

type CliEngine struct {
}

CliEngine handles the CLI based qa

func (*CliEngine) FetchAnswer

func (c *CliEngine) FetchAnswer(prob qatypes.Problem) (answer qatypes.Problem, err error)

FetchAnswer fetches the answer using cli

func (*CliEngine) StartEngine

func (c *CliEngine) StartEngine() error

StartEngine starts the cli engine

type DefaultEngine

type DefaultEngine struct {
}

DefaultEngine returns default values for all questions

func (*DefaultEngine) FetchAnswer

func (c *DefaultEngine) FetchAnswer(prob qatypes.Problem) (ans qatypes.Problem, err error)

FetchAnswer fetches the default answers

func (*DefaultEngine) StartEngine

func (c *DefaultEngine) StartEngine() error

StartEngine starts the default qa engine

type Engine

type Engine interface {
	StartEngine() error
	FetchAnswer(prob qatypes.Problem) (ans qatypes.Problem, err error)
}

Engine defines interface for qa engines

func NewCacheEngine

func NewCacheEngine(cf string) Engine

NewCacheEngine creates a new cache instance

func NewCliEngine

func NewCliEngine() Engine

NewCliEngine creates a new instance of cli engine

func NewDefaultEngine

func NewDefaultEngine() Engine

NewDefaultEngine creates a new instance of default engine

func NewHTTPRESTEngine

func NewHTTPRESTEngine(qaport int) Engine

NewHTTPRESTEngine creates a new instance of Http REST engine

type HTTPRESTEngine

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

HTTPRESTEngine handles qa using HTTP REST services

func (*HTTPRESTEngine) FetchAnswer

func (h *HTTPRESTEngine) FetchAnswer(prob qatypes.Problem) (ans qatypes.Problem, err error)

FetchAnswer fetches the answer using a REST service

func (*HTTPRESTEngine) StartEngine

func (h *HTTPRESTEngine) StartEngine() error

StartEngine starts the QA Engine

Jump to

Keyboard shortcuts

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