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) Sema() *semaph.Semaph
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.
func NewHandler ¶
NewHandler creates a new HTTP service Handler
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
ReloadOK int32
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, fs afs.Service, cfg *config.Model, metrics *gmetric.Service, sema *semaph.Semaph, 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.