backend

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSHA256Hash

func ComputeSHA256Hash(data []byte) string

Types

type Backend

type Backend interface {
	Destroy()

	CreateOrUpdateModel(modeInfo ModelInfo) (ModelInfo, error)
	RetrieveModelInfo(modelID string) (ModelInfo, error)
	RetrieveModelLatestVersionNumber(modelID string) (uint, error)
	HasModel(modelID string) (bool, error)
	DeleteModel(modelID string) error
	ListModels(offset int, limit int) ([]ModelInfo, error)

	CreateOrUpdateModelVersion(modelID string, versionArgs VersionArgs) (VersionInfo, error)
	RetrieveModelVersionInfo(modelID string, versionNumber int) (VersionInfo, error)
	RetrieveModelVersionData(modelID string, versionNumber int) ([]byte, error)
	DeleteModelVersion(modelID string, versionNumber int) error
	ListModelVersionInfos(modelID string, initialVersionNumber uint, limit int) ([]VersionInfo, error)
}

Backend defines the interface for a model registry backend

type ModelInfo

type ModelInfo struct {
	ModelID  string
	UserData map[string]string
}

ModelInfo describes the informations (metadata) for a particular model

type UnknownModelError

type UnknownModelError struct {
	ModelID string
}

UnknownModelError is raised when trying to operate on an unknown model

func (*UnknownModelError) Error

func (e *UnknownModelError) Error() string

type UnknownModelVersionError

type UnknownModelVersionError struct {
	ModelID       string
	VersionNumber int
}

UnknownModelVersionError is raised when trying to operate on an unknown model version

func (*UnknownModelVersionError) Error

func (e *UnknownModelVersionError) Error() string

type VersionArgs

type VersionArgs struct {
	VersionNumber     uint // Set to 0 to create a new version
	CreationTimestamp time.Time
	Archived          bool
	DataHash          string
	Data              []byte
	UserData          map[string]string
}

VersionArgs represents the arguments to create or update a version

type VersionInfo

type VersionInfo struct {
	ModelID           string
	VersionNumber     uint
	CreationTimestamp time.Time
	Archived          bool
	DataHash          string
	DataSize          int
	UserData          map[string]string
}

VersionInfo describes the informations (metadata) for a particular version of a model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL