predictionservice

package
v0.0.0-...-7f60d53 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	ID string `json:"id"`
}

Input describes the request message format

type MessagingConnector

type MessagingConnector interface {
	Request(subj string, data []byte, timeout time.Duration) (*nats.Msg, error)
}

MessagingConnector makes requests to the message broker

type Prediction

type Prediction struct {
	Class       string  `json:"class"`
	Probability float32 `json:"probability"`
}

Prediction describes the response message format

type Service

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

The Service retrieves predictions for a given image from the prediction microservice

func NewService

func NewService(messagingConnector MessagingConnector, messagingSubjectName string) *Service

NewService creates a new instance of the prediction service

func (*Service) GetPredictionForImageID

func (s *Service) GetPredictionForImageID(id string) (*Prediction, error)

GetPredictionForImageID from prediction microservice via messaging

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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