mongodb

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: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func Initialize

func Initialize(conn, dbName, dbCert string) error

func NewAIQuestionMapper

func NewAIQuestionMapper(name, pool string) repositories.AIQuestionMapper

func NewActivityMapper

func NewActivityMapper(name string, keep int) repositories.ActivityMapper

func NewCollection

func NewCollection(name string) collection

func NewCompetitionMapper

func NewCompetitionMapper(name string) repositories.CompetitionMapper

func NewDatasetMapper

func NewDatasetMapper(name string) repositories.DatasetMapper

func NewFinetuneMapper

func NewFinetuneMapper(name string) repositories.FinetuneMapper

func NewInferenceMapper

func NewInferenceMapper(name string) repositories.InferenceMapper

func NewLikeMapper

func NewLikeMapper(name string) repositories.LikeMapper

func NewLoginMapper

func NewLoginMapper(name string) repositories.LoginMapper

func NewLuoJiaMapper

func NewLuoJiaMapper(name string) repositories.LuoJiaMapper

func NewModelMapper

func NewModelMapper(name string) repositories.ModelMapper

func NewProjectMapper

func NewProjectMapper(name string) repositories.ProjectMapper

func NewTagsMapper

func NewTagsMapper(name string) repositories.TagsMapper

func NewTrainingMapper

func NewTrainingMapper(name string) repositories.TrainingMapper

func NewWuKongMapper

func NewWuKongMapper(name string) repositories.WuKongMapper

func NewWuKongPictureMapper

func NewWuKongPictureMapper(name string) repositories.WuKongPictureMapper

Types

type DCompetition

type DCompetition struct {
	Id         string `bson:"id"              json:"id"`
	Name       string `bson:"name"            json:"name"`
	Desc       string `bson:"desc"            json:"desc"`
	Host       string `bson:"host"            json:"host"`
	Type       string `bson:"type"            json:"type"`
	Phase      string `bson:"phase"           json:"phase"`
	Bonus      int    `bson:"bonus"           json:"bonus"`
	Status     string `bson:"status"          json:"status"`
	Duration   string `bson:"duration"        json:"duration"`
	Doc        string `bson:"doc"             json:"doc"`
	Forum      string `bson:"forum"           json:"forum"`
	Poster     string `bson:"poster"          json:"poster"`
	Winners    string `bson:"winners"         json:"winners"`
	DatasetDoc string `bson:"dataset_doc"     json:"dataset_doc"`
	DatasetURL string `bson:"dataset_url"     json:"dataset_url"`
	SmallerOk  bool   `bson:"order"           json:"order"`
	Enabled    bool   `bson:"enabled"         json:"enabled"`

	Teams       []dTeam            `bson:"teams"       json:"-"`
	Repos       []dCompetitionRepo `bson:"repos"       json:"-"`
	Competitors []dCompetitor      `bson:"competitors" json:"-"`
	Submissions []dSubmission      `bson:"submissions" json:"-"`
}

type DCompetitorInfo

type DCompetitorInfo struct {
	Name     string            `bson:"name"      json:"name,omitempty"`
	City     string            `bson:"city"      json:"city,omitempty"`
	Email    string            `bson:"email"     json:"email,omitempty"`
	Phone    string            `bson:"phone"     json:"phone,omitempty"`
	Account  string            `bson:"account"   json:"account,omitempty"`
	Identity string            `bson:"identity"  json:"identity,omitempty"`
	Province string            `bson:"province"  json:"province,omitempty"`
	Detail   map[string]string `bson:"detail"    json:"detail,omitempty"`
}

type DUser

type DUser struct {
	Id primitive.ObjectID `bson:"_id"       json:"-"`

	Name                    string `bson:"name"       json:"name"`
	Email                   string `bson:"email"      json:"email"`
	Bio                     string `bson:"bio"        json:"bio"`
	AvatarId                string `bson:"avatar_id"  json:"avatar_id"`
	PlatformToken           string `bson:"token"      json:"token"`
	PlatformUserId          string `bson:"uid"        json:"uid"`
	PlatformUserNamespaceId string `bson:"nid"        json:"nid"`

	Follower  []string `bson:"follower"   json:"-"`
	Following []string `bson:"following"  json:"-"`

	// Version will be increased by 1 automatically.
	// So, don't marshal it to avoid setting it occasionally.
	Version int `bson:"version"    json:"-"`
}

type DatasetPropertyItem

type DatasetPropertyItem struct {
	FL       byte     `bson:"fl"         json:"fl"`
	Level    int      `bson:"level"      json:"level"`
	Name     string   `bson:"name"       json:"name"`
	Desc     string   `bson:"desc"       json:"desc"`
	Title    string   `bson:"title"      json:"title"`
	RepoType string   `bson:"repo_type"  json:"repo_type"`
	Tags     []string `bson:"tags"       json:"tags"`
	TagKinds []string `bson:"kinds"      json:"kinds"`
}

type ModelPropertyItem

type ModelPropertyItem struct {
	FL       byte     `bson:"fl"         json:"fl"`
	Level    int      `bson:"level"      json:"level"`
	Name     string   `bson:"name"       json:"name"`
	Desc     string   `bson:"desc"       json:"desc"`
	Title    string   `bson:"title"      json:"title"`
	RepoType string   `bson:"repo_type"  json:"repo_type"`
	Tags     []string `bson:"tags"       json:"tags"`
	TagKinds []string `bson:"kinds"      json:"kinds"`
}

type ProjectPropertyItem

type ProjectPropertyItem struct {
	Level    int    `bson:"level"      json:"level"`
	Name     string `bson:"name"       json:"name"`
	FL       byte   `bson:"fl"         json:"fl"`
	Desc     string `bson:"desc"       json:"desc"`
	Title    string `bson:"title"       json:"title"`
	CoverId  string `bson:"cover_id"   json:"cover_id"`
	RepoType string `bson:"repo_type"  json:"repo_type"`
	// set omitempty to avoid set it to null occasionally.
	// don't depend on the magic to guarantee the correctness.
	Tags     []string `bson:"tags"     json:"tags"`
	TagKinds []string `bson:"kinds"    json:"kinds"`
}

type ResourceIndex

type ResourceIndex struct {
	Id    string `bson:"rid"     json:"rid"`
	Owner string `bson:"rowner"  json:"rowner"`
}

type ResourceObject

type ResourceObject struct {
	Id    string `bson:"rid"     json:"rid"`
	Type  string `bson:"rtype"   json:"rtype"`
	Owner string `bson:"rowner"  json:"rowner"`
}

Jump to

Keyboard shortcuts

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