Documentation
¶
Index ¶
- Constants
- type Base
- type BuildCommands
- type BuildImageSpecification
- func (v BuildImageSpecification) MarshalEasyJSON(w *jwriter.Writer)
- func (v BuildImageSpecification) MarshalJSON() ([]byte, error)
- func (b *BuildImageSpecification) PushQ() bool
- func (v *BuildImageSpecification) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *BuildImageSpecification) UnmarshalJSON(data []byte) error
- type BuildSpecification
- type CPUResources
- type CommandsBuildSpecification
- type DataResources
- type DockerHubCredentials
- type Error
- type ErrorCode
- type GPUResources
- type JobRequest
- type JobResponse
- type Limits
- type MountResource
- type MountSource
- type Push
- type RAIBuildSpecification
- type Resources
- type ResponseKind
- type Team
- type User
Constants ¶
const (
Success = ErrorCodeSuccess
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
ID bson.ObjectId `json:"_id" bson:"_id" gorm:"primary_key" toml:"id,omitempty" validate:"required"`
CreatedAt time.Time `json:"created_at" toml:"created_at,omitempty" validate:"required"`
UpdatedAt time.Time `json:"updated_at" toml:"updated_at,omitempty" validate:"required"`
DeletedAt *time.Time `json:"deleted_at" sql:"index" toml:"deleted_at,omitempty"`
}
easyjson:json
func (Base) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Base) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Base) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Base) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type BuildCommands ¶
type BuildCommands []string
easyjson:json
func (BuildCommands) MarshalEasyJSON ¶
func (v BuildCommands) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BuildCommands) MarshalJSON ¶
func (v BuildCommands) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BuildCommands) UnmarshalEasyJSON ¶
func (v *BuildCommands) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BuildCommands) UnmarshalJSON ¶
func (v *BuildCommands) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BuildImageSpecification ¶
type BuildImageSpecification struct {
ImageName string `json:"image_name" yaml:"image_name"`
Dockerfile string `json:"dockerfile" yaml:"dockerfile"`
Push *Push `json:"push" yaml:"push"`
NoCache bool `json:"no_cache" yaml:"no_cache"`
}
easyjson:json
func (BuildImageSpecification) MarshalEasyJSON ¶
func (v BuildImageSpecification) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BuildImageSpecification) MarshalJSON ¶
func (v BuildImageSpecification) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BuildImageSpecification) PushQ ¶
func (b *BuildImageSpecification) PushQ() bool
func (*BuildImageSpecification) UnmarshalEasyJSON ¶
func (v *BuildImageSpecification) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BuildImageSpecification) UnmarshalJSON ¶
func (v *BuildImageSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BuildSpecification ¶
type BuildSpecification struct {
RAI RAIBuildSpecification `json:"rai" yaml:"rai" validate:"required"`
Resources Resources `json:"resources" yaml:"resources" validate:"required"`
Commands CommandsBuildSpecification `json:"commands" yaml:"commands" validate:"required"`
}
easyjson:json
func (BuildSpecification) MarshalEasyJSON ¶
func (v BuildSpecification) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BuildSpecification) MarshalJSON ¶
func (v BuildSpecification) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BuildSpecification) UnmarshalEasyJSON ¶
func (v *BuildSpecification) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BuildSpecification) UnmarshalJSON ¶
func (v *BuildSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CPUResources ¶
type CPUResources struct {
Architecture string `json:"architecture" yaml:"architecture" validate:"required"`
}
easyjson:json
func (CPUResources) MarshalEasyJSON ¶
func (v CPUResources) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CPUResources) MarshalJSON ¶
func (v CPUResources) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CPUResources) UnmarshalEasyJSON ¶
func (v *CPUResources) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CPUResources) UnmarshalJSON ¶
func (v *CPUResources) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type CommandsBuildSpecification ¶
type CommandsBuildSpecification struct {
BuildImage *BuildImageSpecification `json:"build_image,omitempty" yaml:"build_image,omitempty"`
Build BuildCommands `json:"build" yaml:"build"`
}
easyjson:json
func (CommandsBuildSpecification) MarshalEasyJSON ¶
func (v CommandsBuildSpecification) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (CommandsBuildSpecification) MarshalJSON ¶
func (v CommandsBuildSpecification) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*CommandsBuildSpecification) UnmarshalEasyJSON ¶
func (v *CommandsBuildSpecification) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*CommandsBuildSpecification) UnmarshalJSON ¶
func (v *CommandsBuildSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DataResources ¶
type DataResources []MountResource
easyjson:json
func (DataResources) MarshalEasyJSON ¶
func (v DataResources) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DataResources) MarshalJSON ¶
func (v DataResources) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DataResources) UnmarshalEasyJSON ¶
func (v *DataResources) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DataResources) UnmarshalJSON ¶
func (v *DataResources) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DockerHubCredentials ¶
type DockerHubCredentials struct {
Username string `json:"username" yaml:"username" toml:"username" validate:"required"`
Password string `json:"password" yaml:"password" toml:"password" validate:"required"`
}
easyjson:json
func (DockerHubCredentials) MarshalEasyJSON ¶
func (v DockerHubCredentials) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DockerHubCredentials) MarshalJSON ¶
func (v DockerHubCredentials) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DockerHubCredentials) UnmarshalEasyJSON ¶
func (v *DockerHubCredentials) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DockerHubCredentials) UnmarshalJSON ¶
func (v *DockerHubCredentials) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) MarshalJSON ¶
type ErrorCode ¶
type ErrorCode int
func ErrorCodeString ¶
ErrorCodeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ErrorCodeValues ¶
func ErrorCodeValues() []ErrorCode
ErrorCodeValues returns all values of the enum
func (ErrorCode) IsAErrorCode ¶
IsAErrorCode returns "true" if the value is listed in the enum definition. "false" otherwise
func (ErrorCode) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for ErrorCode
func (*ErrorCode) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for ErrorCode
type GPUResources ¶
type GPUResources struct {
Architecture string `json:"architecture" yaml:"architecture" validate:"required"`
Count int `json:"count" yaml:"count" validate:"required"`
Memory int64 `json:"memory" yaml:"memory" validate:"required"`
}
easyjson:json
func (GPUResources) MarshalEasyJSON ¶
func (v GPUResources) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (GPUResources) MarshalJSON ¶
func (v GPUResources) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*GPUResources) UnmarshalEasyJSON ¶
func (v *GPUResources) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*GPUResources) UnmarshalJSON ¶
func (v *GPUResources) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type JobRequest ¶
type JobRequest struct {
ID bson.ObjectId `json:"_id" bson:"_id" gorm:"primary_key" toml:"id,omitempty" validate:"required"`
Base `json:",inline" bson:",inline"`
ClientVersion config.VersionInfo `json:"client_version" validate:"required"`
UploadKey string `json:"upload_key"`
User User `json:"user" validate:"required,dive,required" gorm:"ForeignKey:UserID;AssociationForeignKey:Refer"`
BuildSpecification BuildSpecification `json:"build_specification" validate:"required,dive,required"`
}
easyjson:json
func (JobRequest) MarshalEasyJSON ¶
func (v JobRequest) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (JobRequest) MarshalJSON ¶
func (v JobRequest) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*JobRequest) PushQ ¶
func (j *JobRequest) PushQ() bool
func (*JobRequest) UnmarshalEasyJSON ¶
func (v *JobRequest) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*JobRequest) UnmarshalJSON ¶
func (v *JobRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type JobResponse ¶
type JobResponse struct {
ID string `json:"id" validate:"required"`
Kind ResponseKind `json:"kind" validate:"required"`
Error *Error `json:"error" `
Body []byte `json:"body" validate:"required"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at" validate:"required"`
}
easyjson:json
func (JobResponse) MarshalEasyJSON ¶
func (v JobResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (JobResponse) MarshalJSON ¶
func (v JobResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (JobResponse) TableName ¶
func (JobResponse) TableName() string
func (*JobResponse) UnmarshalEasyJSON ¶
func (v *JobResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*JobResponse) UnmarshalJSON ¶
func (v *JobResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Limits ¶
type Limits struct {
Network bool `json:"network" yaml:"network"`
Time time.Duration `json:"time" yaml:"time"`
DataSize uint64 `json:"datasize" yaml:"datasize"`
}
easyjson:json
func (Limits) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Limits) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Limits) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Limits) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type MountResource ¶
type MountResource struct {
Mount string `json:"mount" yaml:"mount" validate:"required"` // mount location
Source MountSource `json:"source" yaml:"source"`
Cache bool `json:"cache" yaml:"cache"`
}
easyjson:json
func (MountResource) MarshalEasyJSON ¶
func (v MountResource) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (MountResource) MarshalJSON ¶
func (v MountResource) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*MountResource) UnmarshalEasyJSON ¶
func (v *MountResource) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*MountResource) UnmarshalJSON ¶
func (v *MountResource) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type MountSource ¶
type Push ¶
type Push struct {
Push bool `json:"push" yaml:"push"`
ImageName string `json:"image_name" yaml:"image_name"`
Registry string `json:"registry" yaml:"registry"`
Credentials DockerHubCredentials `json:"credentials" yaml:"credentials"`
}
easyjson:json
func (Push) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Push) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Push) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Push) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type RAIBuildSpecification ¶
type RAIBuildSpecification struct {
Version string `json:"version" yaml:"version"`
ContainerImage string `json:"image" yaml:"image"`
}
easyjson:json
func (RAIBuildSpecification) MarshalEasyJSON ¶
func (v RAIBuildSpecification) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (RAIBuildSpecification) MarshalJSON ¶
func (v RAIBuildSpecification) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*RAIBuildSpecification) UnmarshalEasyJSON ¶
func (v *RAIBuildSpecification) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*RAIBuildSpecification) UnmarshalJSON ¶
func (v *RAIBuildSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Resources ¶
type Resources struct {
CPU CPUResources `json:"cpu" yaml:"cpu" validate:"required,dive,required"`
GPU *GPUResources `json:"gpu,omitempty" yaml:"gpu"`
DataResources *DataResources `json:"dataresources,omitempty" yaml:"dataresources"`
Limits Limits `json:"limits" yaml:"limits"`
}
easyjson:json
func (Resources) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Resources) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Resources) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Resources) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ResponseKind ¶
type ResponseKind string
const ( StderrResponse ResponseKind = "Stderr" StdoutResponse ResponseKind = "Stdout" StdinResponse ResponseKind = "Stdin" EndResponse ResponseKind = "End" )
type Team ¶
type Team struct {
Name string `json:"name"`
}
easyjson:json
func (Team) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Team) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Team) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Team) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type User ¶
type User struct {
ID bson.ObjectId `json:"_id" bson:"_id" gorm:"primary_key" toml:"id,omitempty" validate:"required"`
Base `toml:"-" yaml:"-" validate:"required,dive,required"`
Firstname string `json:"firstname" yaml:"firstname,omitempty" toml:"firstname,omitempty" validate:"required"`
Lastname string `json:"lastname" yaml:"lastname,omitempty" toml:"lastname,omitempty" validate:"required"`
Username string `json:"username" yaml:"username" toml:"username"`
Email string `json:"email" yaml:"email" toml:"email" validate:"required,email"`
AccessKey string `json:"access_key" yaml:"access_key" toml:"access_key" validate:"required"`
SecretKey string `json:"secret_key" yaml:"secret_key" toml:"secret_key" validate:"required"`
Affiliation string `json:"affiliation" yaml:"affiliation" toml:"affiliation"`
Password string `json:"password" yaml:"-" toml:"-"`
Team *Team `json:"team" gorm:"ForeignKey:TeamID;AssociationForeignKey:Refer" toml:"-"`
DockerHub *DockerHubCredentials `json:"dockerhub,omitempty" yaml:"dockerhub,omitempty" toml:"dockerhub,omitempty"`
Role acl.Role `json:"role" yaml:"role" validate:"required"`
}
easyjson:json
func (User) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (User) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*User) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*User) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface