Documentation ¶
Overview ¶
store implements a model store which allows downloading models from a remote server
Index ¶
- type Store
- func (s *Store) ById(id string) *schema.Model
- func (s *Store) ByPath(path string) *schema.Model
- func (s *Store) Delete(id string) error
- func (s *Store) Download(ctx context.Context, path string, fn func(curBytes, totalBytes uint64)) (*schema.Model, error)
- func (s *Store) List() []*schema.Model
- func (s *Store) MarshalJSON() ([]byte, error)
- func (s *Store) Rescan() error
- func (s *Store) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
func (*Store) Download ¶
func (s *Store) Download(ctx context.Context, path string, fn func(curBytes, totalBytes uint64)) (*schema.Model, error)
Download a model to the models directory. If the model already exists, it will be returned without downloading. The destination directory is relative to the models directory.
A function can be provided to track the progress of the download. If no Content-Length is provided by the server, the total bytes will be unknown and is set to zero.
func (*Store) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.