Browse Source

新增应用模型参数

pull/53/head
JeshuaRen 4 months ago
parent
commit
2756849a1b
1 changed files with 41 additions and 0 deletions
  1. +41
    -0
      sdks/scheduler/app_models.go

+ 41
- 0
sdks/scheduler/app_models.go View File

@@ -0,0 +1,41 @@
package schsdk

import (
"gitlink.org.cn/cloudream/common/pkgs/types"
"gitlink.org.cn/cloudream/common/utils/serder"
)

type AppInfo interface {
GetAppID() string
}

var AppInfoTypeUnion = types.NewTypeUnion[AppInfo](
(*FederatedLearningAppInfo)(nil),
(*OtherAppInfo)(nil),
)

var _ = serder.UseTypeUnionInternallyTagged(&JobInfoTypeUnion, "type")

type AppInfoBase struct {
ID string `json:"id"`
}

func (i *AppInfoBase) GetAppID() string {
return i.ID
}

type FederatedLearningAppInfo struct {
serder.Metadata `union:"federatedLearning"`
AppInfoBase
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
}

type OtherAppInfo struct {
serder.Metadata `union:"other"`
AppInfoBase
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
}

Loading…
Cancel
Save