pcm-participant/ai/algorithm/algorithm.go

55 lines
1.1 KiB
Go

package algorithm
import "gitlink.org.cn/JointCloud/pcm-participant-ai/platform"
type Algorithms []ISpec
func (algorithm *Algorithms) Algorithms() ([]*Algorithm, error) {
algs := make([]*Algorithm, 0)
for _, a := range *algorithm {
spec, err := a.Spec()
if err != nil {
return nil, err
}
algs = append(algs, spec)
}
return algs, nil
}
type Algorithm struct {
Platform *platform.Platform `json:"platform,omitempty"`
Name string `json:"name,omitempty"`
Desc string `json:"desc,omitempty"`
}
func (a *Algorithm) AlgorithmParam() {
}
type Id struct {
Id string `json:"id,omitempty"`
*Algorithm
}
type IdVsn struct {
Version string `json:"version,omitempty"`
*Id
}
type FilePath struct {
FilePath string `json:"filePath,omitempty"`
*Algorithm
}
type CodeRepository struct {
RepoName string `json:"repoName,omitempty"`
DefaultBranch string `json:"defaultBranch,omitempty"`
BootFile string `json:"bootFile,omitempty"`
Files []*CodeFile `json:"files,omitempty"`
*Algorithm
}
type CodeFile struct {
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
}