Documentation
¶
Overview ¶
Package ocistore is the shared on-disk store for OCI model artifacts.
Index ¶
- type Index
- type IndexEntry
- type Layout
- type ModelRef
- type Store
- func (s *Store) AppendBlob(digest string, r io.Reader, expectedSize int64) error
- func (s *Store) CleanupStaleIncomplete(now time.Time) (int, error)
- func (s *Store) CollectUnused() (int, error)
- func (s *Store) HasBlob(digest string) (bool, error)
- func (s *Store) IncompleteSize(digest string) (int64, error)
- func (s *Store) Open(digest string) (io.ReadCloser, error)
- func (s *Store) ReadBlob(digest string) ([]byte, error)
- func (s *Store) ReadIndex() (Index, error)
- func (s *Store) ReadLayout() (Layout, error)
- func (s *Store) Release(modelName string) error
- func (s *Store) RemoveIncomplete(digest string) error
- func (s *Store) Root() string
- func (s *Store) Track(modelName, digest string, blobs []string) error
- func (s *Store) WriteBlob(digest string, r io.Reader, expectedSize int64) error
- func (s *Store) WriteManifest(digest string, raw []byte, tags []string, files []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
Models []IndexEntry `json:"models"`
}
Index is the DMR-compatible models.json document.
type IndexEntry ¶
type IndexEntry struct {
ID string `json:"id"`
Tags []string `json:"tags"`
Files []string `json:"files"`
}
IndexEntry records one stored artifact and its tags.
type Layout ¶
type Layout struct {
Version string `json:"version"`
}
Layout is the DMR-compatible store marker.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a local content-addressed model artifact store.
func (*Store) AppendBlob ¶
AppendBlob appends to an existing incomplete download.
func (*Store) CleanupStaleIncomplete ¶
CleanupStaleIncomplete removes partial blob downloads older than seven days.
func (*Store) CollectUnused ¶
CollectUnused deletes blobs and manifests that no remaining model claims.
func (*Store) IncompleteSize ¶
IncompleteSize returns the size of a partial blob download, or 0.
func (*Store) Open ¶
func (s *Store) Open(digest string) (io.ReadCloser, error)
Open opens a complete blob for reading.
func (*Store) ReadLayout ¶
ReadLayout returns the store layout document.
func (*Store) Release ¶
Release drops modelName's blob claims. Blobs still claimed by another model are kept.
func (*Store) RemoveIncomplete ¶
RemoveIncomplete deletes a partial blob download.
func (*Store) Track ¶
Track records that modelName claims digest and blobs. Replaces any previous claim.