Live x Resource Synergy
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/models/common/enum"
|
||||
"cloud.o-forge.io/core/oc-lib/models/common/models"
|
||||
"cloud.o-forge.io/core/oc-lib/models/common/pricing"
|
||||
"cloud.o-forge.io/core/oc-lib/models/live"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
"cloud.o-forge.io/core/oc-lib/tools"
|
||||
"github.com/google/uuid"
|
||||
@@ -23,19 +24,6 @@ func (m ServiceMode) String() string {
|
||||
return [...]string{"DEPLOYMENT", "HOSTED"}[m]
|
||||
}
|
||||
|
||||
type ServiceProtocol int
|
||||
|
||||
const (
|
||||
HTTP ServiceProtocol = iota
|
||||
GRPC
|
||||
WEBSOCKET
|
||||
TCP
|
||||
)
|
||||
|
||||
func (p ServiceProtocol) String() string {
|
||||
return [...]string{"HTTP", "GRPC", "WEBSOCKET", "TCP"}[p]
|
||||
}
|
||||
|
||||
type ServiceUsage struct {
|
||||
CPUs map[string]*models.CPU `bson:"cpus,omitempty" json:"cpus,omitempty"`
|
||||
GPUs map[string]*models.GPU `bson:"gpus,omitempty" json:"gpus,omitempty"`
|
||||
@@ -48,10 +36,10 @@ type ServiceUsage struct {
|
||||
// ServiceResourceAccess describes how to reach the service once running.
|
||||
// Populated for HOSTED instances (endpoint already known) and as a template for DEPLOYMENT.
|
||||
type ServiceResourceAccess struct {
|
||||
Container *models.Container `json:"container,omitempty" bson:"container,omitempty"`
|
||||
Protocol ServiceProtocol `json:"protocol" bson:"protocol" default:"0"`
|
||||
EndpointPattern string `json:"endpoint_pattern,omitempty" bson:"endpoint_pattern,omitempty"`
|
||||
HealthCheckPath string `json:"health_check_path,omitempty" bson:"health_check_path,omitempty"`
|
||||
Container *models.Container `json:"container,omitempty" bson:"container,omitempty"`
|
||||
Protocol live.ServiceProtocol `json:"protocol" bson:"protocol" default:"0"`
|
||||
EndpointPattern string `json:"endpoint_pattern,omitempty" bson:"endpoint_pattern,omitempty"`
|
||||
HealthCheckPath string `json:"health_check_path,omitempty" bson:"health_check_path,omitempty"`
|
||||
}
|
||||
|
||||
type ServiceResource struct {
|
||||
|
||||
Reference in New Issue
Block a user