repository

package
v0.0.0-...-d7fecdb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorConcurrentUpdating

func IsErrorConcurrentUpdating(err error) bool

func IsErrorDuplicateCreating

func IsErrorDuplicateCreating(err error) bool

func IsErrorResourceNotExists

func IsErrorResourceNotExists(err error) bool

Types

type AIQuestion

type AIQuestion interface {
	GetResult(string) ([]domain.QuestionSubmissionInfo, error)

	GetCompetitorAndSubmission(string, domain.Account) (
		isCompetitor bool, highestScore int,
		submission domain.QuestionSubmission,
		err error,
	)

	SaveCompetitor(string, *domain.CompetitorInfo) error

	GetQuestions(pool string, choice, completion []int) (
		[]domain.ChoiceQuestion, []domain.CompletionQuestion, error,
	)

	GetSubmission(qid string, user domain.Account, date string) (
		domain.QuestionSubmission, error,
	)

	SaveSubmission(qid string, v *domain.QuestionSubmission) (string, error)
}

type Activity

type Activity interface {
	Save(*domain.UserActivity) error
	Find(domain.Account, ActivityFindOption) ([]domain.Activity, error)
}

type ActivityFindOption

type ActivityFindOption struct {
}

type CompetitionInfo

type CompetitionInfo struct {
	domain.Competition
	CompetitorCount int
}

type CompetitionListOption

type CompetitionListOption struct {
	Status     domain.CompetitionStatus
	Phase      domain.CompetitionPhase
	Competitor domain.Account
}

type CompetitionSummary

type CompetitionSummary struct {
	domain.CompetitionSummary
	CompetitorCount int
}

type DatasetPropertyUpdateInfo

type DatasetPropertyUpdateInfo struct {
	ResourceToUpdate

	Property domain.DatasetModifiableProperty
}

type ErrorConcurrentUpdating

type ErrorConcurrentUpdating struct {
	// contains filtered or unexported fields
}

ErrorConcurrentUpdating

func NewErrorConcurrentUpdating

func NewErrorConcurrentUpdating(err error) ErrorConcurrentUpdating

type ErrorDuplicateCreating

type ErrorDuplicateCreating struct {
	// contains filtered or unexported fields
}

ErrorDuplicateCreating

func NewErrorDuplicateCreating

func NewErrorDuplicateCreating(err error) ErrorDuplicateCreating

type ErrorResourceNotExists

type ErrorResourceNotExists struct {
	// contains filtered or unexported fields
}

ErrorResourceNotExists

func NewErrorResourceNotExists

func NewErrorResourceNotExists(err error) ErrorResourceNotExists

type GlobalResourceListOption

type GlobalResourceListOption struct {
	Level    domain.ResourceLevel
	Tags     []string
	TagKinds []string

	ResourceListOption
}

type Inference

type Inference interface {
	Save(*domain.Inference, int) (string, error)
	UpdateDetail(*domain.InferenceIndex, *domain.InferenceDetail) error
	FindInstance(*domain.InferenceIndex) (InferenceSummary, error)
	FindInstances(index *domain.ResourceIndex, lastCommit string) ([]InferenceSummary, int, error)
}

type InferenceSummary

type InferenceSummary struct {
	Id string

	domain.InferenceDetail
}

type Like

type Like interface {
	Save(*domain.UserLike) error
	Remove(*domain.UserLike) error
	Find(domain.Account, LikeFindOption) ([]domain.Like, error)
	HasLike(domain.Account, *domain.ResourceObject) (bool, error)
}

type LikeFindOption

type LikeFindOption struct {
}

type Login

type Login interface {
	Save(*domain.Login) error
	Get(domain.Account) (domain.Login, error)
}

type LuoJia

type LuoJia interface {
	Save(*domain.UserLuoJiaRecord) (domain.LuoJiaRecord, error)
	List(domain.Account) ([]domain.LuoJiaRecord, error)
}

type Model

type Model interface {
	Save(*domain.Model) (domain.Model, error)
	Delete(*domain.ResourceIndex) error
	Get(domain.Account, string) (domain.Model, error)
	GetByName(domain.Account, domain.ResourceName) (domain.Model, error)
	GetSummaryByName(domain.Account, domain.ResourceName) (domain.ResourceSummary, error)

	FindUserModels([]UserResourceListOption) ([]domain.ModelSummary, error)
	ListSummary([]ResourceSummaryListOption) ([]domain.ResourceSummary, error)

	ListAndSortByUpdateTime(domain.Account, *ResourceListOption) (UserModelsInfo, error)
	ListAndSortByFirstLetter(domain.Account, *ResourceListOption) (UserModelsInfo, error)
	ListAndSortByDownloadCount(domain.Account, *ResourceListOption) (UserModelsInfo, error)

	ListGlobalAndSortByUpdateTime(*GlobalResourceListOption) (UserModelsInfo, error)
	ListGlobalAndSortByFirstLetter(*GlobalResourceListOption) (UserModelsInfo, error)
	ListGlobalAndSortByDownloadCount(*GlobalResourceListOption) (UserModelsInfo, error)

	Search(*ResourceSearchOption) (ResourceSearchResult, error)

	AddLike(*domain.ResourceIndex) error
	RemoveLike(*domain.ResourceIndex) error

	AddRelatedDataset(*RelatedResourceInfo) error
	RemoveRelatedDataset(*RelatedResourceInfo) error

	AddRelatedProject(*domain.ReverselyRelatedResourceInfo) error
	RemoveRelatedProject(*domain.ReverselyRelatedResourceInfo) error

	UpdateProperty(*ModelPropertyUpdateInfo) error

	IncreaseDownload(*domain.ResourceIndex) error
}

type ModelPropertyUpdateInfo

type ModelPropertyUpdateInfo struct {
	ResourceToUpdate

	Property domain.ModelModifiableProperty
}

type Project

type Project interface {
	Save(*domain.Project) (domain.Project, error)
	Delete(*domain.ResourceIndex) error
	Get(domain.Account, string) (domain.Project, error)
	GetByName(domain.Account, domain.ResourceName) (domain.Project, error)
	GetSummary(domain.Account, string) (ProjectSummary, error)
	GetSummaryByName(domain.Account, domain.ResourceName) (domain.ResourceSummary, error)

	FindUserProjects([]UserResourceListOption) ([]domain.ProjectSummary, error)

	ListAndSortByUpdateTime(domain.Account, *ResourceListOption) (UserProjectsInfo, error)
	ListAndSortByFirstLetter(domain.Account, *ResourceListOption) (UserProjectsInfo, error)
	ListAndSortByDownloadCount(domain.Account, *ResourceListOption) (UserProjectsInfo, error)

	ListGlobalAndSortByUpdateTime(*GlobalResourceListOption) (UserProjectsInfo, error)
	ListGlobalAndSortByFirstLetter(*GlobalResourceListOption) (UserProjectsInfo, error)
	ListGlobalAndSortByDownloadCount(*GlobalResourceListOption) (UserProjectsInfo, error)

	Search(*ResourceSearchOption) (ResourceSearchResult, error)

	AddLike(*domain.ResourceIndex) error
	RemoveLike(*domain.ResourceIndex) error

	AddRelatedModel(*RelatedResourceInfo) error
	RemoveRelatedModel(*RelatedResourceInfo) error

	AddRelatedDataset(*RelatedResourceInfo) error
	RemoveRelatedDataset(*RelatedResourceInfo) error

	UpdateProperty(*ProjectPropertyUpdateInfo) error

	IncreaseFork(*domain.ResourceIndex) error
	IncreaseDownload(*domain.ResourceIndex) error
}

type ProjectPropertyUpdateInfo

type ProjectPropertyUpdateInfo struct {
	ResourceToUpdate

	Property domain.ProjectModifiableProperty
}

type ProjectSummary

type ProjectSummary struct {
	domain.ResourceSummary
	Tags []string
}

type RelatedResourceInfo

type RelatedResourceInfo struct {
	ResourceToUpdate

	RelatedResource domain.ResourceIndex
}

type ResourceListOption

type ResourceListOption struct {
	// can't define Name as domain.ResourceName
	// because the Name can be subpart of the real resource name
	Name     string
	RepoType []domain.RepoType

	PageNum      int
	CountPerPage int
}

type ResourceSearchOption

type ResourceSearchOption struct {
	// can't define Name as domain.ResourceName
	// because the Name can be subpart of the real resource name
	Name     string
	TopNum   int
	RepoType []domain.RepoType
}

type ResourceSearchResult

type ResourceSearchResult struct {
	Top []domain.ResourceSummary

	Total int
}

type ResourceSummaryListOption

type ResourceSummaryListOption struct {
	Owner domain.Account
	Name  domain.ResourceName
}

type ResourceToUpdate

type ResourceToUpdate struct {
	Owner     domain.Account
	Id        string
	Version   int
	UpdatedAt int64
}

type Tags

type Tags interface {
	List(domainNames []string) ([]domain.DomainTags, error)
}

type UserDatasetsInfo

type UserDatasetsInfo struct {
	Datasets []domain.DatasetSummary
	Total    int
}

type UserFinetunes

type UserFinetunes struct {
	domain.FinetuneUserInfo

	Version int
	Datas   []domain.FinetuneSummary
}

type UserModelsInfo

type UserModelsInfo struct {
	Models []domain.ModelSummary
	Total  int
}

type UserProjectsInfo

type UserProjectsInfo struct {
	Projects []domain.ProjectSummary
	Total    int
}

type UserResourceListOption

type UserResourceListOption struct {
	Owner domain.Account
	Ids   []string
}

type WuKong

type WuKong interface {
	ListSamples(string, []int) ([]string, error)
}

type WuKongPicture

type WuKongPicture interface {
	GetVersion(domain.Account) (int, error)
	ListLikesByUserName(domain.Account) ([]domain.WuKongPicture, int, error)
	ListPublicsByUserName(domain.Account) ([]domain.WuKongPicture, int, error)
	SaveLike(domain.Account, *domain.WuKongPicture, int) (string, error)
	SavePublic(*domain.WuKongPicture, int) (string, error)
	DeleteLike(domain.Account, string) error
	DeletePublic(domain.Account, string) error
	GetLikeByUserName(domain.Account, string) (domain.WuKongPicture, error)
	GetPublicByUserName(domain.Account, string) (domain.WuKongPicture, error)
	GetPublicsGlobal() ([]domain.WuKongPicture, error)
	GetOfficialPublicsGlobal() ([]domain.WuKongPicture, error)
	UpdatePublicPicture(domain.Account, string, int, *domain.WuKongPicture) error
}

type WuKongPictureListOption

type WuKongPictureListOption struct {
	CountPerPage int
	PageNum      int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL