datastore

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServingGroupNotFound = errors.New("serving group not found")

Functions

This section is empty.

Types

type Role

type Role struct {
	Name     string
	Revision string
	Status   RoleStatus
}

type RoleStatus

type RoleStatus string
const (
	RoleCreating RoleStatus = "Creating"
	RoleRunning  RoleStatus = "Running"
	RoleDeleting RoleStatus = "Deleting"
	RoleNotFound RoleStatus = "NotFound"
)

type ServingGroup

type ServingGroup struct {
	Name string

	Revision string
	Status   ServingGroupStatus
	// contains filtered or unexported fields
}

type ServingGroupStatus

type ServingGroupStatus string
const (
	ServingGroupRunning  ServingGroupStatus = "Running"
	ServingGroupCreating ServingGroupStatus = "Creating"
	ServingGroupDeleting ServingGroupStatus = "Deleting"
	ServingGroupScaling  ServingGroupStatus = "Scaling"
	ServingGroupNotFound ServingGroupStatus = "NotFound"
)

type Store

type Store interface {
	GetServingGroupByModelServing(modelServingName types.NamespacedName) ([]ServingGroup, error)
	GetServingGroup(modelServingName types.NamespacedName, groupName string) *ServingGroup
	GetRunningPodNumByServingGroup(modelServingName types.NamespacedName, groupName string) (int, error)
	GetServingGroupStatus(modelServingName types.NamespacedName, groupName string) ServingGroupStatus
	GetRoleList(modelServingName types.NamespacedName, groupName, roleName string) ([]Role, error)
	GetRoleStatus(modelServingName types.NamespacedName, groupName, roleName, roleID string) RoleStatus
	UpdateRoleStatus(modelServingName types.NamespacedName, groupName, roleName, roleID string, status RoleStatus) error
	DeleteRole(modelServingName types.NamespacedName, groupName, roleName, roleID string)
	DeleteModelServing(modelServingName types.NamespacedName)
	DeleteServingGroup(modelServingName types.NamespacedName, groupName string)
	AddServingGroup(modelServingName types.NamespacedName, idx int, revision string)
	AddRole(modelServingName types.NamespacedName, groupName, roleName, roleID, revision string)
	AddRunningPodToServingGroup(modelServingName types.NamespacedName, groupName, pod, revision, roleName, roleID string)
	// AddServingGroupAndRole adds servingGroup and role if not exist
	AddServingGroupAndRole(modelServingName types.NamespacedName, servingGroupName, revision, roleName, roleID string)
	DeleteRunningPodFromServingGroup(modelServingName types.NamespacedName, groupName string, pod string)
	UpdateServingGroupStatus(modelServingName types.NamespacedName, groupName string, Status ServingGroupStatus) error
}

Store is an interface for storing and retrieving data

func New

func New() Store

Jump to

Keyboard shortcuts

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