rater

package
v0.0.0-...-90229f9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRater

type HTTPRater struct {
	URL        string        `json:"url"`
	MaxRetries int           `json:"maxRetries"`
	Timeout    time.Duration `json:"timeout"`
	// contains filtered or unexported fields
}

HTTPRater implements Rater and executes the rating through a http request which it retries on timeout

func NewHTTPRater

func NewHTTPRater(url string) *HTTPRater

NewHTTPRater for URL

func (*HTTPRater) Rate

func (r *HTTPRater) Rate(ctx context.Context, a, b string) (float32, error)

Rate by sending json to URL and retry on timeout TODO(kwiesmueller): add two-way rating

type Rater

type Rater interface {
	Rate(ctx context.Context, a, b string) (float32, error)
}

Rater provides the interface for rating two segments against eachother

Jump to

Keyboard shortcuts

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