Documentation
¶
Index ¶
- func AwaitConnect(c Connection, retryInterval time.Duration, maxRetries int, ...) (err error)
- func Connect(c Connection) error
- func MakeURL(port int, hostname string, protocol string) string
- func Validate(port int, hostname string) (e error)
- type Connection
- type ElasticConfiguration
- type ElasticConnection
- type MWSConfiguration
- type MWSConnection
- type TemaConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AwaitConnect ¶
func AwaitConnect(c Connection, retryInterval time.Duration, maxRetries int, onFailure func(error)) (err error)
AwaitConnect repeatedly tries to connect to the daemon until the connection suceeds retryInterval is the time to wait between each successive connection attempt. maxRetries is the maximal number of attempts to retry the connection; a value < 0 represents an infinite attempt of attempts onFailure is called whenever a connection attempt fails; might be nil to not be called
func Connect ¶
func Connect(c Connection) error
Connect connects to the daemon represented by this connection
Types ¶
type Connection ¶
type Connection interface {
io.Closer // to close connections
// contains filtered or unexported methods
}
Connection represents the connection to a given daemon
type ElasticConfiguration ¶
type ElasticConfiguration struct {
HarvestIndex string
HarvestType string
SegmentIndex string
SegmentType string
Timeout time.Duration
PoolSize int
MaxPageSize int64
}
ElasticConfiguration represents a TemaSearch Configuration
type ElasticConnection ¶
type ElasticConnection struct {
Client *elastic.Client // underlying http client
Config *ElasticConfiguration // tema configuration
// contains filtered or unexported fields
}
ElasticConnection represents a connection to an ElasticSearch instance
func NewElasticConnection ¶
func NewElasticConnection(port int, hostname string) (conn *ElasticConnection, err error)
NewElasticConnection initializes a new Tema connection
func (*ElasticConnection) Close ¶
func (conn *ElasticConnection) Close() error
Close closes this connection
type MWSConfiguration ¶
MWSConfiguration represents a MathWebSearch Configuration
type MWSConnection ¶
type MWSConnection struct {
Client *http.Client
Config *MWSConfiguration
// contains filtered or unexported fields
}
MWSConnection represents a connection to MathWebSearch
func NewMWSConnection ¶
func NewMWSConnection(port int, hostname string) (conn *MWSConnection, err error)
NewMWSConnection initializes a new MathWebSearch connection
func (*MWSConnection) Close ¶
func (conn *MWSConnection) Close() error
Close closes the connection to MathWebSearch
func (*MWSConnection) URL ¶
func (conn *MWSConnection) URL() string
URL returns the URL to this connection
type TemaConnection ¶
type TemaConnection struct {
MWS *MWSConnection // connection to MathWebSearch
Elastic *ElasticConnection // connection to ElasticSearch
}
TemaConnection represents a connection to a TemaSearch instance, that is a joined (MathWebSearch, ElasticSearch) instance
func NewTemaConnection ¶
func NewTemaConnection(MWSPort int, MWSHost string, ElasticPort int, ElasticHost string) (conn *TemaConnection, err error)
NewTemaConnection makes a new connection to TemaSearch
func (*TemaConnection) Close ¶
func (conn *TemaConnection) Close() error
Close closes this connection