Help us shape the future of Go! Take the 2026 Go Developer Survey

model

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJsonSchema added in v0.1.1

func LoadJsonSchema(name string, i interface{}) (err error)

func SetAccTasks added in v0.1.23

func SetAccTasks(ctx context.Context, db *mongo.Database) (err error)

func SetCategories added in v0.1.8

func SetCategories(ctx context.Context, db *mongo.Database) (err error)

func SetClusters added in v0.1.8

func SetClusters(ctx context.Context, db *mongo.Database) (err error)

func SetImessages added in v0.1.8

func SetImessages(ctx context.Context, db *mongo.Database) (err error)

func SetLogsetImessages added in v0.1.16

func SetLogsetImessages(ctx context.Context, db *mongo.Database) (err error)

func SetLogsetJobs added in v0.1.8

func SetLogsetJobs(ctx context.Context, db *mongo.Database) (err error)

func SetLogsetLogins added in v0.1.16

func SetLogsetLogins(ctx context.Context, db *mongo.Database) (err error)

func SetLogsetOperates added in v0.1.8

func SetLogsetOperates(ctx context.Context, db *mongo.Database) (err error)

func SetPictures added in v0.1.8

func SetPictures(ctx context.Context, db *mongo.Database) (err error)

func SetProjects added in v0.1.8

func SetProjects(ctx context.Context, db *mongo.Database) (err error)

func SetQueues added in v0.1.8

func SetQueues(ctx context.Context, db *mongo.Database) (err error)

func SetSchedules added in v0.1.8

func SetSchedules(ctx context.Context, db *mongo.Database) (err error)

func SetUsers added in v0.1.8

func SetUsers(ctx context.Context, db *mongo.Database) (err error)

func SetVideos added in v0.1.8

func SetVideos(ctx context.Context, db *mongo.Database) (err error)

func SetWorkflows added in v0.1.8

func SetWorkflows(ctx context.Context, db *mongo.Database) (err error)

Types

type AccTask added in v0.1.23

type AccTask struct {
	Kind   string `bson:"kind" json:"kind"`
	Source string `bson:"source" json:"source"`
	Target string `bson:"target" json:"target"`
}

type Category added in v0.1.0

type Category struct {
	ID         primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Type       string             `bson:"type" json:"type"`
	Name       string             `bson:"name" json:"name"`
	Sort       int64              `bson:"sort" json:"sort"`
	CreateTime time.Time          `bson:"create_time" json:"create_time"`
	UpdateTime time.Time          `bson:"update_time" json:"update_time"`
}

type Cluster added in v0.1.0

type Cluster struct {
	ID         primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Name       string             `bson:"name" json:"name"`
	Kind       string             `bson:"kind" json:"kind"`
	Config     string             `bson:"config" json:"config"`
	CreateTime time.Time          `bson:"create_time" json:"create_time"`
	UpdateTime time.Time          `bson:"update_time" json:"update_time"`
}

type ClusterKubeConfig added in v0.1.0

type ClusterKubeConfig struct {
	Host     string `json:"host"`
	CAData   string `json:"ca_data"`
	CertData string `json:"cert_data"`
	KeyData  string `json:"key_data"`
}

type Imessage added in v0.1.0

type Imessage struct {
	ID          primitive.ObjectID   `bson:"_id,omitempty" json:"_id"`
	Topic       string               `bson:"topic" json:"topic"`
	Description string               `bson:"description" json:"description"`
	Projects    []primitive.ObjectID `bson:"projects" json:"projects"`
	CreateTime  time.Time            `bson:"create_time" json:"create_time" farker:"-"`
	UpdateTime  time.Time            `bson:"update_time" json:"update_time" farker:"-"`
}

type LogsetLogin added in v0.1.16

type LogsetLogin struct {
	Timestamp time.Time           `bson:"timestamp" json:"timestamp"`
	Metadata  LogsetLoginMetadata `bson:"metadata" json:"metadata"`
	UserAgent string              `bson:"user_agent" json:"user_agent"`
	Detail    interface{}         `bson:"detail" json:"detail"`
}

func NewLogsetLogin added in v0.1.16

func NewLogsetLogin(uid primitive.ObjectID, ip string, source string, useragent string) *LogsetLogin

func (*LogsetLogin) SetDetail added in v0.1.16

func (x *LogsetLogin) SetDetail(v interface{})

func (*LogsetLogin) SetVersion added in v0.1.16

func (x *LogsetLogin) SetVersion(v string)

type LogsetLoginMetadata added in v0.1.16

type LogsetLoginMetadata struct {
	UserID   primitive.ObjectID `bson:"user_id" json:"-"`
	ClientIP string             `bson:"client_ip" json:"client_ip"`
	Version  string             `bson:"version" json:"version"`
	Source   string             `bson:"source" json:"source" json:"source"`
}

type Picture added in v0.1.0

type Picture struct {
	ID         primitive.ObjectID   `bson:"_id,omitempty" json:"_id"`
	Name       string               `bson:"name" json:"name"`
	Url        string               `bson:"url" json:"url"`
	Query      string               `bson:"query" json:"query"`
	Process    PictureProcess       `bson:"process" json:"process"`
	Categories []primitive.ObjectID `bson:"categories" json:"categories"`
	CreateTime time.Time            `bson:"create_time" json:"create_time"`
	UpdateTime time.Time            `bson:"update_time" json:"update_time"`
}

type PictureProcess added in v0.1.0

type PictureProcess struct {
	Mode int64              `bson:"mode" json:"mode"`
	Cut  PictureProcessCut  `bson:"cut" json:"cut"`
	Zoom PictureProcessZoom `bson:"zoom" json:"zoom"`
}

type PictureProcessCut added in v0.1.0

type PictureProcessCut struct {
	X int64 `bson:"x" json:"x"`
	Y int64 `bson:"y" json:"y"`
	W int64 `bson:"w" json:"w"`
	H int64 `bson:"h" json:"h"`
}

type PictureProcessZoom added in v0.1.0

type PictureProcessZoom struct {
	W int64 `bson:"w" json:"w"`
	H int64 `bson:"h" json:"h"`
}

type Project added in v0.0.29

type Project struct {
	ID         primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Name       string             `bson:"name" json:"name" faker:"first_name"`
	Namespace  string             `bson:"namespace" json:"namespace" faker:"username,unique"`
	Kind       string             `bson:"kind" json:"kind"`
	SecretId   string             `bson:"secret_id" json:"secret_id" faker:"unique"`
	SecretKey  string             `bson:"secret_key" json:"secret_key"`
	Entry      []string           `bson:"entry" json:"entry" farker:"-"`
	Expire     *time.Time         `bson:"expire" json:"expire" farker:"-"`
	Status     bool               `bson:"status" json:"status"`
	CreateTime time.Time          `bson:"create_time" json:"create_time" farker:"-"`
	UpdateTime time.Time          `bson:"update_time" json:"update_time" farker:"-"`
}

func NewProject added in v0.0.29

func NewProject(name string, namespace string) *Project

type Queue added in v0.1.0

type Queue struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Project     primitive.ObjectID `bson:"project" json:"project"`
	Name        string             `bson:"name" json:"name"`
	Description string             `bson:"description" json:"description"`
	Subjects    []string           `bson:"subjects" json:"subjects"`
	MaxMsgs     int64              `bson:"max_msgs" json:"max_msgs"`
	MaxBytes    int64              `bson:"max_bytes" json:"max_bytes"`
	MaxAge      time.Duration      `bson:"max_age" json:"max_age"`
	CreateTime  time.Time          `bson:"create_time" json:"create_time" farker:"-"`
	UpdateTime  time.Time          `bson:"update_time" json:"update_time" farker:"-"`
}

type Schedule added in v0.1.0

type Schedule struct {
	ID         primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Name       string             `bson:"name" json:"name"`
	Node       string             `bson:"node" json:"node"`
	CreateTime time.Time          `bson:"create_time" json:"create_time"`
	UpdateTime time.Time          `bson:"update_time" json:"update_time"`
}

type User

type User struct {
	ID         primitive.ObjectID   `bson:"_id,omitempty" json:"_id"`
	Email      string               `bson:"email" json:"email"`
	Password   string               `bson:"password" json:"-"`
	Roles      []primitive.ObjectID `bson:"roles" json:"-"`
	Name       string               `bson:"name" json:"name"`
	Avatar     string               `bson:"avatar" json:"avatar"`
	Phone      string               `bson:"phone,omitempty" json:"-"`
	Totp       string               `bson:"totp,omitempty" json:"-"`
	Lark       *UserLark            `bson:"lark,omitempty" json:"lark"`
	Sessions   int64                `bson:"sessions,omitempty" json:"sessions"`
	History    *LogsetLogin         `bson:"history,omitempty" json:"history"`
	Status     bool                 `bson:"status" json:"status"`
	CreateTime time.Time            `bson:"create_time" json:"create_time"`
	UpdateTime time.Time            `bson:"update_time" json:"update_time"`
}

func NewUser

func NewUser(email string, password string) *User

type UserLark added in v0.1.0

type UserLark struct {
	AccessToken      string `bson:"access_token" json:"access_token"`
	TokenType        string `bson:"token_type" json:"token_type"`
	ExpiresIn        uint64 `bson:"expires_in" json:"expires_in"`
	Name             string `bson:"name" json:"name"`
	EnName           string `bson:"en_name" json:"en_name"`
	AvatarUrl        string `bson:"avatar_url" json:"avatar_url"`
	AvatarThumb      string `bson:"avatar_thumb" json:"avatar_thumb"`
	AvatarMiddle     string `bson:"avatar_middle" json:"avatar_middle"`
	AvatarBig        string `bson:"avatar_big" json:"avatar_big"`
	OpenId           string `bson:"open_id" json:"open_id"`
	UnionId          string `bson:"union_id" json:"union_id"`
	Email            string `bson:"email" json:"email"`
	EnterpriseEmail  string `bson:"enterprise_email" json:"enterprise_email"`
	UserId           string `bson:"user_id" json:"user_id"`
	Mobile           string `bson:"mobile" json:"mobile"`
	TenantKey        string `bson:"tenant_key" json:"tenant_key"`
	RefreshExpiresIn uint64 `bson:"refresh_expires_in" json:"refresh_expires_in"`
	RefreshToken     string `bson:"refresh_token" json:"refresh_token"`
	Sid              string `bson:"sid" json:"sid"`
}

type Video added in v0.1.0

type Video struct {
	ID         primitive.ObjectID   `bson:"_id,omitempty" json:"_id"`
	Name       string               `bson:"name" json:"name"`
	Url        string               `bson:"url" json:"url"`
	Categories []primitive.ObjectID `bson:"categories" json:"categories"`
	CreateTime time.Time            `bson:"create_time" json:"create_time"`
	UpdateTime time.Time            `bson:"update_time" json:"update_time"`
}

type Workflow added in v0.1.0

type Workflow struct {
	ID         primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
	Project    primitive.ObjectID `bson:"project" json:"project"`
	Kind       string             `bson:"kind" json:"kind"`
	Name       string             `bson:"name" json:"name"`
	Schedule   *WorkflowSchedule  `bson:"schedule" json:"schedule"`
	CreateTime time.Time          `bson:"create_time" json:"create_time"`
	UpdateTime time.Time          `bson:"update_time" json:"update_time"`
}

type WorkflowSchedule added in v0.1.0

type WorkflowSchedule struct {
	ScheduleId *primitive.ObjectID   `bson:"schedule_id" json:"schedule_id"`
	Status     bool                  `bson:"status" json:"status"`
	Jobs       []WorkflowScheduleJob `bson:"jobs" json:"jobs"`
}

type WorkflowScheduleJob added in v0.1.0

type WorkflowScheduleJob struct {
	Mode   string `bson:"mode" json:"mode"`
	Spec   string `bson:"spec" json:"spec"`
	Option bson.M `bson:"option" json:"option"`
}

Jump to

Keyboard shortcuts

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