Documentation
¶
Index ¶
- 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 ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler converts a model prediction HTTP request to its internal calls.
type Option ¶
type Option interface {
Apply(c *Service)
}
func WithDataStorer ¶
WithDataStorer creates dictionary option
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()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.