|
- package schsdk
-
- import (
- "gitlink.org.cn/cloudream/common/pkgs/types"
- cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
- "gitlink.org.cn/cloudream/common/utils/serder"
- )
-
- type AppInstanceID int64
-
- type ParticipantID string
-
- type AppSetInfo struct {
- Apps []AppInfo `json:"apps"`
- }
-
- type AppInfo interface {
- GetLocalJobID() string
- GetAppInstanceID() int64
- }
-
- var AppInfoTypeUnion = types.NewTypeUnion[AppInfo](
- (*FederatedLearningAppInfo)(nil),
- (*OtherAppInfo)(nil),
- )
-
- var _ = serder.UseTypeUnionInternallyTagged(&AppInfoTypeUnion, "type")
-
- type AppInfoBase struct {
- LocalJobID string `json:"localJobID"`
- AppInstanceID int64 `json:"appInstanceID"` // 应用实例ID
- }
-
- func (i *AppInfoBase) GetLocalJobID() string {
- return i.LocalJobID
- }
-
- func (i *AppInfoBase) GetAppInstanceID() int64 {
- return i.AppInstanceID
- }
-
- // FederatedLearningAppInfo 云际联邦学习应用信息
- type FederatedLearningAppInfo struct {
- serder.Metadata `union:"federatedLearning"`
- AppInfoBase
- Type string `json:"type"`
-
- AppInstanceID AppInstanceID `json:"appInstanceID"`
- Name string `json:"name"`
- Description string `json:"description"`
-
- ParticipantCount int `json:"participantCount"` //参与者人数
- JobInfo JobInfo `json:"jobInfo"` //作业信息
- Role string `json:"role"` //角色,initiator/participant
- IsDataReturn bool `json:"isDataReturn"` // 是否需要数据回源
- ParticipantInfo ParticipantInfo `json:"participantInfo"`
- ParticipantIDs []ParticipantID `json:"participantIDs"` //参与者ID列表
- JoinedCount int64 `json:"joinedCount"` //已经参与的人数
- }
-
- type ParticipantInfo struct {
- DatasetBindID cdssdk.ObjectID `json:"datasetBindID"` //数据集绑定id
- }
-
- type OtherAppInfo struct {
- serder.Metadata `union:"other"`
- AppInfoBase
- Type string `json:"type"`
- Name string `json:"name"`
- Description string `json:"description"`
- }
|