Documentation
¶
Index ¶
- func WithMaxEvaluatorWait(wait time.Duration) *maxEvaluatorWait
- type Handler
- type Option
- type Response
- type Service
- func (s *Service) Close() error
- func (s *Service) Config() *config.Model
- func (s *Service) Dictionary() *common.Dictionary
- func (s *Service) Do(ctx context.Context, request *request.Request, response *Response) error
- func (s *Service) NewRequest() *request.Request
- func (s *Service) Signature() *domain.Signature
- func (s *Service) Stats() map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithMaxEvaluatorWait ¶ added in v0.12.4
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler converts a model prediction HTTP request to its internal calls.
func NewHandler ¶
func NewHandler(service *Service, pool *buffer.Pool, maxDuration time.Duration, m *gmetric.Service, lrOV prometheus.ObserverVec) *Handler
NewHandler creates a new HTTP service Handler
type Response ¶
type Response struct { Status string Error string DictHash int Data interface{} ServiceTimeMcs int // contains filtered or unexported fields }
Response represents service response
func (*Response) MarshalJSONObject ¶
MarshalJSONObject marshal response
type Service ¶
type Service struct { // reload TODO finish refactor ReloadOK int32 // contains filtered or unexported fields }
Service serves as the entrypoint for using the ML model. It is responsible for caching, the ML model provides some metadata related to caching.
func New ¶
func New(ctx context.Context, cfg *config.Model, tfsrv *tfmodel.Service, fs afs.Service, metrics *gmetric.Service, datastores map[string]*datastore.Service, options ...Option) (*Service, error)
New creates a service
func (*Service) Dictionary ¶
func (s *Service) Dictionary() *common.Dictionary
func (*Service) NewRequest ¶
NewRequest should be used for Do()
Click to show internal directories.
Click to hide internal directories.