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

model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 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 SetupCategory added in v0.1.1

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

func SetupCluster added in v0.1.1

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

func SetupImessage added in v0.1.1

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

func SetupLogsetLogined added in v0.1.1

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

func SetupPicture added in v0.1.1

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

func SetupProject added in v0.1.1

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

func SetupQueue added in v0.1.1

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

func SetupSchedule added in v0.1.1

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

func SetupUser added in v0.1.1

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

func SetupVideo added in v0.1.1

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

func SetupWorkflow added in v0.1.1

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

Types

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 LogsetLogined added in v0.1.0

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

func NewLogsetLogined added in v0.1.0

func NewLogsetLogined(uid primitive.ObjectID, ip string, source string, useragent string) *LogsetLogined

func (*LogsetLogined) SetDetail added in v0.1.0

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

func (*LogsetLogined) SetVersion added in v0.1.0

func (x *LogsetLogined) SetVersion(v string)

type LogsetLoginedMetadata added in v0.1.0

type LogsetLoginedMetadata 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"`
	ClusterId  primitive.ObjectID `bson:"cluster_id" json:"cluster_id"`
	Name       string             `bson:"name" json:"name"`
	Image      string             `bson:"image" json:"image"`
	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    *LogsetLogined       `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"`
	Name       string             `bson:"name" json:"name"`
	Kind       string             `bson:"kind" json:"kind"`
	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