Documentation ¶
Index ¶
- Constants
- func GenActivityForCreatingResource(obj domain.ResourceObject, repotype domain.RepoType) domain.UserActivity
- func GenActivityForDeletingResource(obj *domain.ResourceObject, repoType domain.RepoType) domain.UserActivity
- func Init(cfg *Config)
- func IsErrorUnavailableTraining(err error) bool
- type AIQuestionAnswerSubmitCmd
- type AIQuestionDTO
- type ActivityDTO
- type ActivityService
- type ChallengeCompetitorInfoDTO
- type ChallengeRankingDTO
- type ChallengeService
- type ChoiceQuestionDTO
- type CodeGeexCmd
- type CodeGeexDTO
- type CompetitionAddRelatedProjectCMD
- type CompetitionDTO
- type CompetitionIndex
- type CompetitionInternalService
- type CompetitionListCMD
- type CompetitionService
- type CompetitionSubmissionDTO
- type CompetitionSubmissionInfo
- type CompetitionSubmissionsDTO
- type CompetitionSubmitCMD
- type CompetitionSummaryDTO
- type CompetitionTeamDTO
- type CompetitionTeamMemberDTO
- type CompetitorApplyCmd
- type CompletionQuestionDTO
- type ComputeDTO
- type Config
- type DatasetCreateCmd
- type DatasetDTO
- type DatasetDetailDTO
- type DatasetMessageService
- type DatasetService
- type DatasetSummaryDTO
- type DatasetUpdateCmd
- type DatasetsDTO
- type DomainTagsDTO
- type ErrorDuplicateTrainingName
- type ErrorExccedMaxTrainingRecord
- type ErrorExceedMaxRelatedResourceNum
- type ErrorOnlyOneRunningTraining
- type ErrorPreviewLFSFile
- type ErrorPrivateRepo
- type ErrorUnavailableRepoFile
- type ErrorUpdateLFSFile
- type FinetuneConfig
- type FinetuneCreateCmd
- type FinetuneIndex
- type FinetuneInternalService
- type FinetuneJobDTO
- type FinetuneJobDetail
- type FinetuneMessageService
- type FinetuneService
- type FinetuneSummaryDTO
- type GlobalDatasetDTO
- type GlobalDatasetsDTO
- type GlobalModelDTO
- type GlobalModelsDTO
- type GlobalResourceListCmd
- type JobDetail
- type KeyValueDTO
- type LikeCreateCmd
- type LikeDTO
- type LikeRemoveCmd
- type LikeService
- type LoginCreateCmd
- type LoginDTO
- type LoginService
- type LuoJiaRecordDTO
- type ModelCreateCmd
- type ModelDTO
- type ModelDetailDTO
- type ModelMessageService
- type ModelService
- type ModelSummaryDTO
- type ModelUpdateCmd
- type ModelsDTO
- type ProjectMessageService
- type RankingDTO
- type RepoDir
- type RepoDirDeleteCmd
- type RepoDirInfo
- type RepoFileContent
- type RepoFileCreateCmd
- type RepoFileDeleteCmd
- type RepoFileDownloadCmd
- type RepoFileDownloadDTO
- type RepoFileInfo
- type RepoFileListCmd
- type RepoFilePreviewCmd
- type RepoFileService
- type RepoFileUpdateCmd
- type RepoPathItem
- type ResourceDTO
- type ResourceIndexCmd
- type ResourceListCmd
- type ResourceSearchDTO
- type ResourceService
- func (s ResourceService) CanApplyResourceName(owner domain.Account, name domain.ResourceName) bool
- func (s ResourceService) FindUserAvater(users []userdomain.Account) ([]string, error)
- func (s ResourceService) IsPrivate(owner domain.Account, resourceType domain.ResourceType, id string) (isprivate bool, ok bool)
- func (s ResourceService) ListDatasets(resources []domain.ResourceIndex) (dtos []ResourceDTO, err error)
- func (s ResourceService) ListModels(resources []domain.ResourceIndex) (dtos []ResourceDTO, err error)
- type ResourceSummaryDTO
- type ResourceTagsUpdateCmd
- type ReverselyRelatedResourceInfo
- type SearchDTO
- type SearchService
- type TagsService
- type TrainingConfig
- type TrainingConfigDTO
- type TrainingCreateCmd
- type TrainingDTO
- type TrainingIndex
- type TrainingRefDTO
- type TrainingService
- type TrainingSummaryDTO
- type UserCompetitionDTO
- type UserFinetunesDTO
- type UserInfo
- type UserSearchDTO
- type WuKongAddDiggCmd
- type WuKongAddLikeFromPublicCmd
- type WuKongAddLikeFromTempCmd
- type WuKongAddPublicFromLikeCmd
- type WuKongAddPublicFromTempCmd
- type WuKongCancelDiggCmd
- type WuKongCmd
- type WuKongIsLikeDTO
- type WuKongLikeDTO
- type WuKongListPublicGlobalCmd
- type WuKongPictureBaseDTO
- type WuKongPictureListOption
- type WuKongPicturesListCmd
- type WuKongPublicDTO
- type WuKongPublicGlobalDTO
Constants ¶
View Source
const ( ErrorCodeSystem = "system" // It exceed the max times for a day. ErrorCodeAIQuestionExceedMaxTimes = "aiquestion_exceed_max_times" ErrorCodeAIQuestionSubmissionExpiry = "aiquestion_submission_expiry" ErrorCodeAIQuestionSubmissionUnmatchedTimes = "aiquestion_submission_unmatched_times" ErrorRepoFileTooManyFilesToDelete = "repofile_too_many_files_to_delete" ErrorCompetitionDuplicateSubmission = "competition_duplicate_submission" ErrorBigModelSensitiveInfo = "bigmodel_sensitive_info" ErrorBigModelRecourseBusy = "bigmodel_resource_busy" ErrorTrainNoLog = "train_no_log" ErrorTrainNoOutput = "train_no_output" ErrorTrainNotFound = "train_not_found" ErrorTrainExccedMaxNum = "train_excced_max_num" // excced max training num for a user ErrorWuKongInvalidId = "wukong_invalid_id" ErrorWuKongInvalidOwner = "wukong_invalid_owner" ErrorWuKongInvalidPath = "wukong_invalid_path" ErrorWuKongNoAuthorization = "wukong_no_authorization" ErrorWuKongInvalidLink = "wukong_invalid_link" ErrorWuKongDuplicateLike = "wukong_duplicate_like" ErrorWuKongExccedMaxLikeNum = "wukong_excced_max_like_num" ErrorFinetuneExpiry = "finetune_expiry" ErrorFinetuneNotFound = "finetune_not_found" ErrorFinetuneExccedMaxNum = "finetune_excced_max_num" ErrorFinetuneNoPermission = "finetune_no_permission" ErrorFinetuneRunningJobExists = "finetune_running_job_exists" ErrorAICCFinetuneNoLog = "aicc_finetune_no_log" ErrorAICCFinetuneNotFound = "aicc_finetune_not_found" )
Variables ¶
This section is empty.
Functions ¶
func GenActivityForCreatingResource ¶ added in v1.3.2
func GenActivityForCreatingResource(obj domain.ResourceObject, repotype domain.RepoType) domain.UserActivity
func GenActivityForDeletingResource ¶ added in v1.3.2
func GenActivityForDeletingResource(obj *domain.ResourceObject, repoType domain.RepoType) domain.UserActivity
Types ¶
type AIQuestionDTO ¶
type AIQuestionDTO struct { Times int `json:"times"` Answer string `json:"answer"` Choices []ChoiceQuestionDTO `json:"choices"` Completions []CompletionQuestionDTO `json:"completions"` }
type ActivityDTO ¶
type ActivityDTO struct { Type string `json:"type"` Time string `json:"time"` Resource ResourceDTO `json:"resource"` }
type ActivityService ¶
type ActivityService interface {
List(domain.Account, bool) ([]ActivityDTO, error)
}
func NewActivityService ¶
func NewActivityService( repo repository.Activity, user userrepo.User, model repository.Model, project spacerepo.Project, dataset repository.Dataset, ) ActivityService
type ChallengeRankingDTO ¶
type ChallengeService ¶
type ChallengeService interface { Apply(*CompetitorApplyCmd) error GetCompetitor(domain.Account) (ChallengeCompetitorInfoDTO, error) GetAIQuestions(domain.Account) (AIQuestionDTO, string, error) SubmitAIQuestionAnswer(domain.Account, *AIQuestionAnswerSubmitCmd) (int, string, error) GetRankingList() ([]ChallengeRankingDTO, error) }
func NewChallengeService ¶
func NewChallengeService( competitionRepo repository.Competition, aiQuestionRepo repository.AIQuestion, helper challenge.Challenge, encryption utils.SymmetricEncryption, userRepo userrepo.User, ) ChallengeService
type ChoiceQuestionDTO ¶
type CodeGeexCmd ¶
type CodeGeexCmd bigmodel.CodeGeexReq
func (*CodeGeexCmd) Validate ¶
func (cmd *CodeGeexCmd) Validate() error
type CodeGeexDTO ¶
type CodeGeexDTO = bigmodel.CodeGeexResp
type CompetitionAddRelatedProjectCMD ¶ added in v1.3.1
type CompetitionAddRelatedProjectCMD struct { Index CompetitionIndex Competitor domain.Account Project domain.ResourceSummary }
type CompetitionDTO ¶
type CompetitionIndex ¶
type CompetitionIndex = domain.CompetitionIndex
type CompetitionInternalService ¶
type CompetitionInternalService interface {
UpdateSubmission(*CompetitionIndex, *CompetitionSubmissionInfo) error
}
Internal Service
func NewCompetitionInternalService ¶
func NewCompetitionInternalService(repo repository.Competition) CompetitionInternalService
type CompetitionListCMD ¶
type CompetitionListCMD = repository.CompetitionListOption
type CompetitionService ¶
type CompetitionService interface { Apply(string, *CompetitorApplyCmd) error Get(cid string, competitor domain.Account) (UserCompetitionDTO, error) List(*CompetitionListCMD) ([]CompetitionSummaryDTO, error) Submit(*CompetitionSubmitCMD) (CompetitionSubmissionDTO, string, error) GetSubmissions(*CompetitionIndex, domain.Account) (CompetitionSubmissionsDTO, error) GetTeam(cid string, competitor domain.Account) (CompetitionTeamDTO, error) GetRankingList(cid string, phase domain.CompetitionPhase) ([]RankingDTO, error) AddRelatedProject(*CompetitionAddRelatedProjectCMD) error }
func NewCompetitionService ¶
func NewCompetitionService( repo repository.Competition, sender message.Sender, uploader competition.Competition, ) CompetitionService
type CompetitionSubmissionInfo ¶
type CompetitionSubmissionInfo = domain.CompetitionSubmissionInfo
type CompetitionSubmissionsDTO ¶
type CompetitionSubmissionsDTO struct { RelatedProject string `json:"project"` Details []CompetitionSubmissionDTO `json:"details"` }
result
type CompetitionSubmitCMD ¶
type CompetitionSummaryDTO ¶
type CompetitionTeamDTO ¶
type CompetitionTeamDTO struct { Name string `json:"name"` Members []CompetitionTeamMemberDTO `json:"members"` }
team
type CompetitorApplyCmd ¶
type CompetitorApplyCmd domain.CompetitorInfo
func (*CompetitorApplyCmd) Validate ¶
func (cmd *CompetitorApplyCmd) Validate() error
type CompletionQuestionDTO ¶
type ComputeDTO ¶
type Config ¶
type Config struct { WuKongMaxLikeNum int `json:"wukong_max_like_num" required:"true"` FinetuneMaxNum int `json:"finetune_max_num" required:"true"` }
func (*Config) SetDefault ¶
func (cfg *Config) SetDefault()
type DatasetCreateCmd ¶
type DatasetCreateCmd struct { Owner domain.Account Name domain.ResourceName Desc domain.ResourceDesc Title domain.ResourceTitle RepoType domain.RepoType Protocol domain.ProtocolName Tags []string TagKinds []string All []domain.DomainTags }
func (*DatasetCreateCmd) Validate ¶
func (cmd *DatasetCreateCmd) Validate() error
type DatasetDTO ¶
type DatasetDTO struct { Id string `json:"id"` Owner string `json:"owner"` Name string `json:"name"` Desc string `json:"desc"` Title string `json:"title"` Protocol string `json:"protocol"` RepoType string `json:"repo_type"` RepoId string `json:"repo_id"` Tags []string `json:"tags"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` LikeCount int `json:"like_count"` DownloadCount int `json:"download_count"` }
type DatasetDetailDTO ¶
type DatasetDetailDTO struct { DatasetDTO RelatedModels []ResourceDTO `json:"related_models"` RelatedProjects []ResourceDTO `json:"related_projects"` }
type DatasetMessageService ¶
type DatasetMessageService interface { AddRelatedProject(*ReverselyRelatedResourceInfo) error RemoveRelatedProject(*ReverselyRelatedResourceInfo) error AddRelatedModel(*ReverselyRelatedResourceInfo) error RemoveRelatedModel(*ReverselyRelatedResourceInfo) error AddLike(*domain.ResourceIndex) error RemoveLike(*domain.ResourceIndex) error IncreaseDownload(*domain.ResourceIndex) error }
dataset
func NewDatasetMessageService ¶
func NewDatasetMessageService(repo repository.Dataset) DatasetMessageService
type DatasetService ¶
type DatasetService interface { CanApplyResourceName(domain.Account, domain.ResourceName) bool Create(*DatasetCreateCmd, platform.Repository) (DatasetDTO, error) Delete(*domain.Dataset, platform.Repository) error Update(*domain.Dataset, *DatasetUpdateCmd, platform.Repository) (DatasetDTO, error) GetByName(domain.Account, domain.ResourceName, bool) (DatasetDetailDTO, error) List(domain.Account, *ResourceListCmd) (DatasetsDTO, error) ListGlobal(*GlobalResourceListCmd) (GlobalDatasetsDTO, error) SetTags(*domain.Dataset, *ResourceTagsUpdateCmd) error }
func NewDatasetService ¶
func NewDatasetService( user userrepo.User, repo repository.Dataset, proj spacerepo.Project, model repository.Model, activity repository.Activity, pr platform.Repository, sender message.ResourceProducer, audit auditcommon.AuditService, fileScanRepo filescanrepo.FileScanAdapter, ) DatasetService
type DatasetSummaryDTO ¶
type DatasetSummaryDTO struct { Id string `json:"id"` Owner string `json:"owner"` Name string `json:"name"` Desc string `json:"desc"` Title string `json:"title"` Tags []string `json:"tags"` UpdatedAt string `json:"updated_at"` LikeCount int `json:"like_count"` DownloadCount int `json:"download_count"` }
type DatasetUpdateCmd ¶
type DatasetUpdateCmd struct { Name domain.ResourceName Desc domain.ResourceDesc Title domain.ResourceTitle RepoType domain.RepoType }
type DatasetsDTO ¶
type DatasetsDTO struct { Total int `json:"total"` Datasets []DatasetSummaryDTO `json:"datasets"` }
type DomainTagsDTO ¶
type DomainTagsDTO = domain.DomainTags
type ErrorDuplicateTrainingName ¶
type ErrorDuplicateTrainingName struct {
// contains filtered or unexported fields
}
type ErrorExccedMaxTrainingRecord ¶
type ErrorExccedMaxTrainingRecord struct {
// contains filtered or unexported fields
}
type ErrorExceedMaxRelatedResourceNum ¶
type ErrorExceedMaxRelatedResourceNum struct {
// contains filtered or unexported fields
}
type ErrorOnlyOneRunningTraining ¶
type ErrorOnlyOneRunningTraining struct {
// contains filtered or unexported fields
}
type ErrorPreviewLFSFile ¶
type ErrorPreviewLFSFile struct {
// contains filtered or unexported fields
}
type ErrorPrivateRepo ¶
type ErrorPrivateRepo struct {
// contains filtered or unexported fields
}
type ErrorUnavailableRepoFile ¶
type ErrorUnavailableRepoFile struct {
// contains filtered or unexported fields
}
type ErrorUpdateLFSFile ¶
type ErrorUpdateLFSFile struct {
// contains filtered or unexported fields
}
type FinetuneConfig ¶
type FinetuneConfig = domain.FinetuneConfig
type FinetuneCreateCmd ¶
type FinetuneCreateCmd struct { User domain.Account domain.FinetuneConfig }
func (*FinetuneCreateCmd) Validate ¶
func (cmd *FinetuneCreateCmd) Validate() error
type FinetuneIndex ¶
type FinetuneIndex = domain.FinetuneIndex
type FinetuneInternalService ¶
type FinetuneInternalService interface {
UpdateJobDetail(*FinetuneIndex, *FinetuneJobDetail) error
}
FinetuneInternalService
func NewFinetuneInternalService ¶
func NewFinetuneInternalService( repo repository.Finetune, ) FinetuneInternalService
type FinetuneJobDTO ¶
type FinetuneJobDetail ¶
type FinetuneJobDetail = domain.FinetuneJobDetail
type FinetuneMessageService ¶
type FinetuneMessageService interface {
CreateFinetuneJob(*FinetuneIndex, bool) (bool, error)
}
FinetuneMessageService
func NewFinetuneMessageService ¶
func NewFinetuneMessageService( fs finetune.Finetune, repo repository.Finetune, ) FinetuneMessageService
type FinetuneService ¶
type FinetuneService interface { Create(*FinetuneCreateCmd) (string, string, error) List(user domain.Account) (UserFinetunesDTO, string, error) Delete(*FinetuneIndex) error Terminate(*FinetuneIndex) error GetJobInfo(*FinetuneIndex) (FinetuneJobDTO, string, error) }
func NewFinetuneService ¶
func NewFinetuneService( fs finetune.Finetune, repo repository.Finetune, sender message.Sender, ) FinetuneService
type FinetuneSummaryDTO ¶
type GlobalDatasetDTO ¶
type GlobalDatasetDTO struct { DatasetSummaryDTO AvatarId string `json:"avatar_id"` }
type GlobalDatasetsDTO ¶
type GlobalDatasetsDTO struct { Total int `json:"total"` Datasets []GlobalDatasetDTO `json:"projects"` }
Dataset
type GlobalModelDTO ¶
type GlobalModelDTO struct { ModelSummaryDTO AvatarId string `json:"avatar_id"` }
type GlobalModelsDTO ¶
type GlobalModelsDTO struct { Total int `json:"total"` Models []GlobalModelDTO `json:"projects"` }
Model
type GlobalResourceListCmd ¶
type GlobalResourceListCmd struct { repository.GlobalResourceListOption SortType domain.SortType }
func (*GlobalResourceListCmd) ToResourceListOption ¶ added in v1.3.2
func (cmd *GlobalResourceListCmd) ToResourceListOption() repository.GlobalResourceListOption
type KeyValueDTO ¶
type LikeCreateCmd ¶
type LikeCreateCmd struct { ResourceOwner domain.Account ResourceType domain.ResourceType ResourceId string }
func (*LikeCreateCmd) Validate ¶
func (cmd *LikeCreateCmd) Validate() error
type LikeDTO ¶
type LikeDTO struct { Time string `json:"time"` Resource ResourceDTO `json:"resource"` }
type LikeRemoveCmd ¶
type LikeRemoveCmd = LikeCreateCmd
type LikeService ¶
type LikeService interface { Create(domain.Account, LikeCreateCmd) error Delete(domain.Account, LikeRemoveCmd) error List(domain.Account) ([]LikeDTO, error) }
func NewLikeService ¶
func NewLikeService( repo repository.Like, user userrepo.User, model repository.Model, project spacerepo.Project, dataset repository.Dataset, activity repository.Activity, sender message.LikeMessageProducer, ) LikeService
type LoginCreateCmd ¶
func (*LoginCreateCmd) Validate ¶
func (cmd *LoginCreateCmd) Validate() error
type LoginService ¶
type LoginService interface { Create(*LoginCreateCmd) error Get(domain.Account) (LoginDTO, error) SignIn(domain.Account) error }
func NewLoginService ¶
func NewLoginService(repo repository.Login, sender message.UserSignedInMessageProducer) LoginService
type LuoJiaRecordDTO ¶
type ModelCreateCmd ¶
type ModelCreateCmd struct { Owner domain.Account Name domain.ResourceName Desc domain.ResourceDesc Title domain.ResourceTitle RepoType domain.RepoType Protocol domain.ProtocolName Tags []string TagKinds []string All []domain.DomainTags }
func (*ModelCreateCmd) Validate ¶
func (cmd *ModelCreateCmd) Validate() error
type ModelDTO ¶
type ModelDTO struct { Id string `json:"id"` Owner string `json:"owner"` Name string `json:"name"` Desc string `json:"desc"` Title string `json:"title"` Protocol string `json:"protocol"` RepoType string `json:"repo_type"` RepoId string `json:"repo_id"` Tags []string `json:"tags"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` LikeCount int `json:"like_count"` DownloadCount int `json:"download_count"` }
type ModelDetailDTO ¶
type ModelDetailDTO struct { ModelDTO RelatedDatasets []ResourceDTO `json:"related_datasets"` RelatedProjects []ResourceDTO `json:"related_projects"` }
type ModelMessageService ¶
type ModelMessageService interface { AddRelatedProject(*ReverselyRelatedResourceInfo) error RemoveRelatedProject(*ReverselyRelatedResourceInfo) error AddRelatedDataset(*ReverselyRelatedResourceInfo) error RemoveRelatedDataset(*ReverselyRelatedResourceInfo) error AddLike(*domain.ResourceIndex) error RemoveLike(*domain.ResourceIndex) error IncreaseDownload(*domain.ResourceIndex) error }
model
func NewModelMessageService ¶
func NewModelMessageService(repo repository.Model) ModelMessageService
type ModelService ¶
type ModelService interface { CanApplyResourceName(domain.Account, domain.ResourceName) bool Create(*ModelCreateCmd, platform.Repository) (ModelDTO, error) Delete(*domain.Model, platform.Repository) error Update(*domain.Model, *ModelUpdateCmd, platform.Repository) (ModelDTO, error) GetByName(domain.Account, domain.ResourceName, bool) (ModelDetailDTO, error) List(domain.Account, *ResourceListCmd) (ModelsDTO, error) ListGlobal(*GlobalResourceListCmd) (GlobalModelsDTO, error) AddRelatedDataset(*domain.Model, *domain.ResourceIndex) error RemoveRelatedDataset(*domain.Model, *domain.ResourceIndex) error SetTags(*domain.Model, *ResourceTagsUpdateCmd) error }
func NewModelService ¶
func NewModelService( user userrepo.User, repo repository.Model, proj spacerepo.Project, dataset repository.Dataset, activity repository.Activity, pr platform.Repository, sender message.ResourceProducer, audit auditcommon.AuditService, fileScanRepo filescanrepo.FileScanAdapter, ) ModelService
type ModelSummaryDTO ¶
type ModelSummaryDTO struct { Id string `json:"id"` Owner string `json:"owner"` Name string `json:"name"` Desc string `json:"desc"` Title string `json:"title"` Tags []string `json:"tags"` UpdatedAt string `json:"updated_at"` LikeCount int `json:"like_count"` DownloadCount int `json:"download_count"` }
type ModelUpdateCmd ¶
type ModelUpdateCmd struct { Name domain.ResourceName Desc domain.ResourceDesc Title domain.ResourceTitle RepoType domain.RepoType }
type ModelsDTO ¶
type ModelsDTO struct { Total int `json:"total"` Models []ModelSummaryDTO `json:"models"` }
type ProjectMessageService ¶
type ProjectMessageService interface { AddRelatedModel(*ReverselyRelatedResourceInfo) error RemoveRelatedModel(*ReverselyRelatedResourceInfo) error AddRelatedDataset(*ReverselyRelatedResourceInfo) error RemoveRelatedDataset(*ReverselyRelatedResourceInfo) error AddLike(*domain.ResourceIndex) error RemoveLike(*domain.ResourceIndex) error IncreaseFork(*domain.ResourceIndex) error IncreaseDownload(*domain.ResourceIndex) error }
project
func NewProjectMessageService ¶
func NewProjectMessageService(repo spacerepo.Project) ProjectMessageService
type RankingDTO ¶
type RankingDTO struct { Score float32 `json:"score"` TeamName string `json:"team_name"` SubmitAt string `json:"submit_at"` }
ranking
type RepoDirDeleteCmd ¶
type RepoDirDeleteCmd = RepoDirInfo
type RepoDirInfo ¶
type RepoDirInfo = platform.RepoDirInfo
type RepoFileContent ¶
type RepoFileContent = platform.RepoFileContent
type RepoFileCreateCmd ¶
type RepoFileCreateCmd struct { RepoFileInfo RepoFileContent }
func (*RepoFileCreateCmd) Validate ¶
func (cmd *RepoFileCreateCmd) Validate() error
type RepoFileDeleteCmd ¶
type RepoFileDeleteCmd = RepoFileInfo
type RepoFileDownloadCmd ¶
type RepoFileDownloadCmd struct { MyAccount domain.Account MyToken string Path domain.FilePath Type domain.ResourceType Resource domain.ResourceSummary }
type RepoFileDownloadDTO ¶
type RepoFileInfo ¶
type RepoFileInfo = platform.RepoFileInfo
type RepoFileListCmd ¶
type RepoFileListCmd = RepoDir
type RepoFilePreviewCmd ¶
type RepoFilePreviewCmd = RepoFileInfo
type RepoFileService ¶
type RepoFileService interface { List(u *UserInfo, d *RepoDir) ([]RepoPathItem, error) Create(*UserInfo, *RepoFileCreateCmd) error Update(*UserInfo, *RepoFileUpdateCmd) error Delete(*UserInfo, *RepoFileDeleteCmd) error Preview(*UserInfo, *RepoFilePreviewCmd) ([]byte, error) DeleteDir(*UserInfo, *RepoDirDeleteCmd) (string, error) Download(*RepoFileDownloadCmd) (RepoFileDownloadDTO, error) DownloadByRepoId(string, domain.FilePath) (RepoFileDownloadDTO, error) StreamDownload(string, domain.FilePath, func(io.Reader, int64)) error DownloadRepo(u *UserInfo, obj *domain.RepoDownloadedEvent, handle func(io.Reader, int64)) error }
func NewRepoFileService ¶
func NewRepoFileService( rf platform.RepoFile, sender message.RepoMessageProducer, filescan filescanapp.FileScanService) RepoFileService
type RepoFileUpdateCmd ¶
type RepoFileUpdateCmd = RepoFileCreateCmd
type RepoPathItem ¶
type RepoPathItem = platform.RepoPathItem
type ResourceDTO ¶
type ResourceDTO struct { Owner struct { Name string `json:"name"` AvatarId string `json:"avatar_id"` } `json:"owner"` Id string `json:"id"` Name string `json:"name"` Type string `json:"type"` Desc string `json:"description"` Title string `json:"title"` CoverId string `json:"cover_id"` UpdateAt string `json:"update_at"` Tags []string `json:"tags"` ResourceLevel string `json:"level"` LikeCount int `json:"like_count"` ForkCount int `json:"fork_count"` DownloadCount int `json:"download_count"` }
type ResourceIndexCmd ¶
type ResourceIndexCmd = domain.ResourceIndex
type ResourceListCmd ¶
type ResourceListCmd struct { repository.ResourceListOption SortType domain.SortType }
func (*ResourceListCmd) ToResourceListOption ¶ added in v1.3.2
func (cmd *ResourceListCmd) ToResourceListOption() repository.ResourceListOption
type ResourceSearchDTO ¶
type ResourceSearchDTO struct { Top []ResourceSummaryDTO `json:"top"` Total int `json:"total"` }
type ResourceService ¶ added in v1.3.2
type ResourceService struct { User userrepo.User Model repository.Model Project spacerepo.Project Dataset repository.Dataset }
func (ResourceService) CanApplyResourceName ¶ added in v1.3.2
func (s ResourceService) CanApplyResourceName(owner domain.Account, name domain.ResourceName) bool
func (ResourceService) FindUserAvater ¶ added in v1.3.2
func (s ResourceService) FindUserAvater(users []userdomain.Account) ([]string, error)
func (ResourceService) IsPrivate ¶ added in v1.3.2
func (s ResourceService) IsPrivate(owner domain.Account, resourceType domain.ResourceType, id string, ) (isprivate bool, ok bool)
func (ResourceService) ListDatasets ¶ added in v1.3.2
func (s ResourceService) ListDatasets(resources []domain.ResourceIndex) ( dtos []ResourceDTO, err error, )
func (ResourceService) ListModels ¶ added in v1.3.2
func (s ResourceService) ListModels(resources []domain.ResourceIndex) ( dtos []ResourceDTO, err error, )
type ResourceSummaryDTO ¶
type ResourceTagsUpdateCmd ¶
type ResourceTagsUpdateCmd struct { ToAdd []string ToRemove []string All []domain.DomainTags }
func (*ResourceTagsUpdateCmd) GenTagKinds ¶ added in v1.3.2
func (cmd *ResourceTagsUpdateCmd) GenTagKinds(tags []string) []string
type ReverselyRelatedResourceInfo ¶
type ReverselyRelatedResourceInfo = domain.ReverselyRelatedResourceInfo
type SearchDTO ¶
type SearchDTO struct { User UserSearchDTO `json:"user"` Model ResourceSearchDTO `json:"model"` Project ResourceSearchDTO `json:"project"` Dataset ResourceSearchDTO `json:"dataset"` }
type SearchService ¶
func NewSearchService ¶
func NewSearchService( user userrepo.User, model repository.Model, project spacerepo.Project, dataset repository.Dataset, ) SearchService
type TagsService ¶
type TagsService interface {
List([]string) ([]DomainTagsDTO, error)
}
func NewTagsService ¶
func NewTagsService(repo repository.Tags) TagsService
type TrainingConfig ¶
type TrainingConfig = domain.TrainingConfig
type TrainingConfigDTO ¶
type TrainingConfigDTO struct { Name string `json:"name"` Desc string `json:"desc"` CodeDir string `json:"code_dir"` BootFile string `json:"boot_file"` Hyperparameters []KeyValueDTO `json:"hyperparameter"` Env []KeyValueDTO `json:"env"` Inputs []TrainingRefDTO `json:"inputs"` EnableAim bool `json:"enable_aim"` EnableOutput bool `json:"enable_output"` Compute ComputeDTO `json:"compute"` }
type TrainingCreateCmd ¶
type TrainingCreateCmd struct { User domain.Account ProjectId string domain.TrainingConfig }
func (*TrainingCreateCmd) Validate ¶
func (cmd *TrainingCreateCmd) Validate() error
type TrainingDTO ¶
type TrainingDTO struct { Id string `json:"id"` ProjectId string `json:"project_id"` Name string `json:"name"` Desc string `json:"desc"` IsDone bool `json:"is_done"` Error string `json:"error"` Status string `json:"status"` Duration int `json:"duration"` CreatedAt string `json:"created_at"` Compute ComputeDTO `json:"compute"` AimPath string `json:"aim_path"` EnableAim bool `json:"enable_aim"` LogPreviewURL string `json:"-"` }
type TrainingIndex ¶
type TrainingIndex = domain.TrainingIndex
type TrainingRefDTO ¶
type TrainingService ¶
type TrainingService interface { Create(*TrainingCreateCmd) (string, error) Recreate(*TrainingIndex) (string, error) UpdateJobDetail(*TrainingIndex, *JobDetail) error List(user domain.Account, projectId string) ([]TrainingSummaryDTO, error) Get(*TrainingIndex) (TrainingDTO, string, error) GetLastTrainingConfig(*ResourceIndexCmd) (dto TrainingConfigDTO, code string, err error) Delete(*TrainingIndex) error Terminate(*TrainingIndex) error GetLogDownloadURL(*TrainingIndex) (string, string, error) GetOutputDownloadURL(*TrainingIndex) (string, string, error) CreateTrainingJob(*TrainingIndex, string, bool) (bool, error) }
func NewTrainingService ¶
func NewTrainingService( train training.Training, repo repository.Training, sender message.MessageProducer, maxTrainingRecordNum int, ) TrainingService
type TrainingSummaryDTO ¶
type UserCompetitionDTO ¶
type UserCompetitionDTO struct { IsCompetitor bool `json:"is_competitor"` TeamId string `json:"team_id"` TeamRole string `json:"team_role"` CompetitionDTO }
type UserFinetunesDTO ¶
type UserFinetunesDTO struct { Expiry int64 `json:"expiry"` Data []FinetuneSummaryDTO `json:"data"` }
type UserSearchDTO ¶
type WuKongAddDiggCmd ¶
type WuKongAddPublicFromTempCmd ¶
type WuKongAddPublicFromTempCmd = WuKongAddLikeFromTempCmd
type WuKongCancelDiggCmd ¶
type WuKongCancelDiggCmd WuKongAddDiggCmd
type WuKongCmd ¶
type WuKongCmd domain.WuKongPictureMeta
type WuKongIsLikeDTO ¶
type WuKongLikeDTO ¶
type WuKongLikeDTO struct { IsPublic bool `json:"is_public"` WuKongPictureBaseDTO }
type WuKongListPublicGlobalCmd ¶
type WuKongListPublicGlobalCmd struct { User domain.Account Level domain.WuKongPictureLevel WuKongPictureListOption }
func (*WuKongListPublicGlobalCmd) Validate ¶
func (cmd *WuKongListPublicGlobalCmd) Validate() error
type WuKongPictureBaseDTO ¶
type WuKongPictureListOption ¶
type WuKongPicturesListCmd ¶
type WuKongPicturesListCmd = repository.WuKongPictureListOption
type WuKongPublicDTO ¶
type WuKongPublicGlobalDTO ¶
type WuKongPublicGlobalDTO struct { Pictures []WuKongPublicDTO `json:"pictures"` Total int `json:"total"` }
Source Files ¶
- activity.go
- bigmodel_dto.go
- challenge.go
- challenge_dto.go
- competition.go
- competition_dto.go
- config.go
- dataset.go
- dataset_dto.go
- error.go
- finetune.go
- finetune_dto.go
- global.go
- like.go
- login.go
- login_dto.go
- message_service.go
- model.go
- orderByTime.go
- repofile.go
- resource.go
- search.go
- tags.go
- training.go
- training_dto.go
- update_dataset.go
- update_model.go
- update_resource.go
Click to show internal directories.
Click to hide internal directories.