Documentation ¶
Index ¶
Constants ¶
View Source
const ( // could access everything // used to add/remove users // to/from projects UserType_ADMIN = pb.UserType_ADMIN // used to submit job // for ordinary students UserType_USER = pb.UserType_USER // special authorization // could read project // but can NOT submit job UserType_BOT = pb.UserType_BOT )
Variables ¶
View Source
var (
ProjectConfigDefaultStages = []string{
"install",
"build",
"test",
}
)
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` ProjectId bson.ObjectId `bson:"project_id,omitempty" json:"project_id,omitempty"` UserId bson.ObjectId `bson:"user_id,omitempty" json:"user_id,omitempty"` Progress pb.JobProgress `bson:"progress,omitempty" json:"progress,omitempty"` Score int32 `bson:"score,omitempty" json:"score,omitempty"` Log string `bson:"log,omitempty" json:"log,omitempty"` Error *Status `bson:"error,omitempty" json:"error,omitempty"` }
type Project ¶
type Project struct { // Required: project id Id bson.ObjectId `bson:"_id,omitempty" json:"id"` // Required: project name Name string `bson:"name,omitempty" json:"name,omitempty"` // Optional: description Desc string `bson:"desc,omitempty" json:"desc,omitempty"` Config *ProjectConfig `bson:"config,omitempty" json:"config,omitempty"` // Meta is NOT in using //Meta *structpb.Struct `bson:"meta,omitempty" json:"meta,omitempty"` CreateTime time.Time `bson:"create_time,omitempty" json:"create_time,omitempty"` UpdatedTime time.Time `bson:"updated_time,omitempty" json:"updated_time,omitempty"` CreatedBy string `bson:"created_by,omitempty" json:"created_by"` }
func FromPbProject ¶
type ProjectChecklistElem ¶
type ProjectConfig ¶
type ProjectConfig struct { Image string `bson:"image,omitempty" json:"image" yaml:"image"` Env []string `bson:"env,omitempty" json:"env" yaml:"env"` Volume []string `bson:"volume,omitempty" json:"volume" yaml:"volume"` Stages []string `bson:"stage,omitempty" json:"stage" yaml:"stage"` Jobs map[string]ProjectJobConfig `bson:"job,omitempty" json:"job" yaml:"job"` Checklist []*pb.ProjectChecklistElem `bson:"check_list,omitempty" json:"check_list" yaml:"check_list"` TimeoutSec uint64 `bson:"timeout_sec,omitempty" json:"timeout_sec" yaml:"timeout_sec"` MaximumCpu uint64 `bson:"maximum_cpu,omitempty" json:"maximum_cpu" yaml:"maximum_cpu"` MaximumMemMb uint64 `bson:"maximum_mem_mb,omitempty" json:"maximum_mem_mb" yaml:"maximum_mem_mb"` }
func LoadProjectConfig ¶
func LoadProjectConfig(path string) (*ProjectConfig, error)
func (*ProjectConfig) ToBashScriptsExecutor ¶
func (c *ProjectConfig) ToBashScriptsExecutor() *helpers.BashScriptsExecutor
func (*ProjectConfig) ToPbProjectConfig ¶
func (c *ProjectConfig) ToPbProjectConfig(rich bool) (pbConfig *pb.ProjectConfig)
type ProjectJobConfig ¶
type Secret ¶
type Secret struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` UserId bson.ObjectId `bson:"user_id,omitempty" json:"user_id"` Secret string `bson:"secret,omitempty" json:"secret"` TempToken string `bson:"temp_token,omitempty" json:"temp_token"` CreateTime time.Time `bson:"create_time,omitempty" json:"create_time,omitempty"` UpdatedTime time.Time `bson:"updated_time,omitempty" json:"updated_time,omitempty"` }
func FromPbSecret ¶
func (*Secret) ToPbSecret ¶
func (*Secret) UpdateTime ¶
type User ¶
type User struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` UserType pb.UserType `bson:"user_type,omitempty" json:"user_type,omitempty"` Name string `bson:"name,omitempty" json:"name,omitempty"` DisplayName string `bson:"display_name,omitempty" json:"display_name,omitempty"` Email string `bson:"email,omitempty" json:"email,omitempty"` CreateTime time.Time `bson:"create_time,omitempty" json:"create_time,omitempty"` UpdatedTime time.Time `bson:"updated_time,omitempty" json:"updated_time,omitempty"` CreatedBy string `bson:"created_by,omitempty" json:"created_by"` }
func FromPbUser ¶
func (*User) UpdateTime ¶
type UserServiceFilterOption ¶
type UserServiceFilterOption struct { UserType []pb.UserType Order OrderType // 0: ignore, 1: asc, 2: desc Name string // user name Query string }
func ParseUserServiceFilterOption ¶
func ParseUserServiceFilterOption(filter string) (opt *UserServiceFilterOption)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.