Documentation
¶
Index ¶
- Variables
- func AssertDataSpecRequired(obj DataSpec) error
- func AssertJobSpecRequired(obj JobSpec) error
- func AssertJobStatusRequired(obj JobStatus) error
- func AssertOptimizerRequired(obj Optimizer) error
- func AssertRecurseDataSpecRequired(objSlice interface{}) error
- func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error
- func AssertRecurseJobSpecRequired(objSlice interface{}) error
- func AssertRecurseJobStatusRequired(objSlice interface{}) error
- func AssertRecurseOptimizerRequired(objSlice interface{}) error
- func AssertRecurseSelectorRequired(objSlice interface{}) error
- func AssertRecurseTaskInfoRequired(objSlice interface{}) error
- func AssertRecurseTaskStatusRequired(objSlice interface{}) error
- func AssertRecurseTaskTypeRequired(objSlice interface{}) error
- func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error
- func AssertSelectorRequired(obj Selector) error
- func AssertTaskInfoRequired(obj TaskInfo) error
- func AssertTaskStatusRequired(obj TaskStatus) error
- func AssertTaskTypeRequired(obj TaskType) error
- func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
- func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
- func IsZeroValue(val interface{}) bool
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type BaseModel
- type Channel
- type ChannelGroupBy
- type CommBackend
- type Connector
- type DataSpec
- type DatasetInfo
- type DatasetsApiController
- func (c *DatasetsApiController) CreateDataset(w http.ResponseWriter, r *http.Request)
- func (c *DatasetsApiController) GetAllDatasets(w http.ResponseWriter, r *http.Request)
- func (c *DatasetsApiController) GetDataset(w http.ResponseWriter, r *http.Request)
- func (c *DatasetsApiController) GetDatasets(w http.ResponseWriter, r *http.Request)
- func (c *DatasetsApiController) Routes() Routes
- func (c *DatasetsApiController) UpdateDataset(w http.ResponseWriter, r *http.Request)
- type DatasetsApiRouter
- type DatasetsApiServicer
- type Design
- type DesignCodesApiController
- func (c *DesignCodesApiController) CreateDesignCode(w http.ResponseWriter, r *http.Request)
- func (c *DesignCodesApiController) GetDesignCode(w http.ResponseWriter, r *http.Request)
- func (c *DesignCodesApiController) Routes() Routes
- func (c *DesignCodesApiController) UpdateDesignCode(w http.ResponseWriter, r *http.Request)
- type DesignCodesApiRouter
- type DesignCodesApiServicer
- type DesignInfo
- type DesignSchema
- type DesignSchemas
- type DesignSchemasApiController
- func (c *DesignSchemasApiController) CreateDesignSchema(w http.ResponseWriter, r *http.Request)
- func (c *DesignSchemasApiController) GetDesignSchema(w http.ResponseWriter, r *http.Request)
- func (c *DesignSchemasApiController) GetDesignSchemas(w http.ResponseWriter, r *http.Request)
- func (c *DesignSchemasApiController) Routes() Routes
- func (c *DesignSchemasApiController) UpdateDesignSchema(w http.ResponseWriter, r *http.Request)
- type DesignSchemasApiRouter
- type DesignSchemasApiServicer
- type DesignsApiController
- type DesignsApiRouter
- type DesignsApiServicer
- type Error
- type ErrorHandler
- type ImplResponse
- type JobPriority
- type JobSpec
- type JobState
- type JobStatus
- type JobsApiController
- func (c *JobsApiController) CreateJob(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) DeleteJob(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) GetJob(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) GetJobStatus(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) GetJobs(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) GetTask(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) GetTaskInfo(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) GetTasksInfo(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) Routes() Routes
- func (c *JobsApiController) UpdateJob(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) UpdateJobStatus(w http.ResponseWriter, r *http.Request)
- func (c *JobsApiController) UpdateTaskStatus(w http.ResponseWriter, r *http.Request)
- type JobsApiOption
- type JobsApiRouter
- type JobsApiServicer
- type Optimizer
- type ParsingError
- type RequiredError
- type Role
- type Route
- type Router
- func NewDatasetsApiController(s DatasetsApiServicer) Router
- func NewDesignCodesApiController(s DesignCodesApiServicer) Router
- func NewDesignSchemasApiController(s DesignSchemasApiServicer) Router
- func NewDesignsApiController(s DesignsApiServicer) Router
- func NewJobsApiController(s JobsApiServicer, opts ...JobsApiOption) Router
- type Routes
- type Selector
- type TaskInfo
- type TaskStatus
- type TaskType
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTypeAssertionError is thrown when type an interface does not match the asserted type ErrTypeAssertionError = errors.New("unable to assert type") )
Functions ¶
func AssertDataSpecRequired ¶
AssertDataSpecRequired checks if the required fields are not zero-ed
func AssertJobSpecRequired ¶
AssertJobSpecRequired checks if the required fields are not zero-ed
func AssertJobStatusRequired ¶ added in v0.1.2
AssertJobStatusRequired checks if the required fields are not zero-ed
func AssertOptimizerRequired ¶ added in v0.1.2
AssertOptimizerRequired checks if the required fields are not zero-ed
func AssertRecurseDataSpecRequired ¶
func AssertRecurseDataSpecRequired(objSlice interface{}) error
AssertRecurseDataSpecRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of DataSpec (e.g. [][]DataSpec), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseInterfaceRequired ¶
AssertInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a preorder fashion.
func AssertRecurseJobSpecRequired ¶
func AssertRecurseJobSpecRequired(objSlice interface{}) error
AssertRecurseJobSpecRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of JobSpec (e.g. [][]JobSpec), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseJobStatusRequired ¶ added in v0.1.2
func AssertRecurseJobStatusRequired(objSlice interface{}) error
AssertRecurseJobStatusRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of JobStatus (e.g. [][]JobStatus), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseOptimizerRequired ¶ added in v0.1.2
func AssertRecurseOptimizerRequired(objSlice interface{}) error
AssertRecurseOptimizerRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Optimizer (e.g. [][]Optimizer), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseSelectorRequired ¶
func AssertRecurseSelectorRequired(objSlice interface{}) error
AssertRecurseSelectorRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Selector (e.g. [][]Selector), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTaskInfoRequired ¶
func AssertRecurseTaskInfoRequired(objSlice interface{}) error
AssertRecurseTaskInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TaskInfo (e.g. [][]TaskInfo), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTaskStatusRequired ¶ added in v0.1.2
func AssertRecurseTaskStatusRequired(objSlice interface{}) error
AssertRecurseTaskStatusRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TaskStatus (e.g. [][]TaskStatus), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTaskTypeRequired ¶
func AssertRecurseTaskTypeRequired(objSlice interface{}) error
AssertRecurseTaskTypeRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TaskType (e.g. [][]TaskType), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseValueRequired ¶
AssertNestedValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a preorder fashion.
func AssertSelectorRequired ¶
AssertSelectorRequired checks if the required fields are not zero-ed
func AssertTaskInfoRequired ¶
AssertTaskInfoRequired checks if the required fields are not zero-ed
func AssertTaskStatusRequired ¶ added in v0.1.2
func AssertTaskStatusRequired(obj TaskStatus) error
AssertTaskStatusRequired checks if the required fields are not zero-ed
func AssertTaskTypeRequired ¶
AssertTaskTypeRequired checks if the required fields are not zero-ed
func DefaultErrorHandler ¶
func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func IsZeroValue ¶
func IsZeroValue(val interface{}) bool
IsZeroValue checks if the val is the zero-ed value.
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type Channel ¶
type Channel struct { Name string `json:"name"` Description string `json:"description,omitempty"` Pair []string `json:"pair"` GroupBy ChannelGroupBy `json:"groupBy,omitempty"` FuncTags map[string][]string `json:"funcTags,omitempty"` IsUnidirectional bool `json:"isUnidirectional,omitempty"` }
Channel - Defines how different roles are connected.
type ChannelGroupBy ¶
type CommBackend ¶
type CommBackend string
const ( MQTT CommBackend = "mqtt" P2P CommBackend = "p2p" )
List of CommBackend
type DatasetInfo ¶
type DatasetInfo struct { Id string `json:"id,omitempty"` UserId string `json:"userId,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Url string `json:"url"` DataFormat string `json:"dataFormat"` Realm string `json:"realm"` IsPublic bool `json:"isPublic,omitempty"` }
DatasetInfo - dataset meta information
type DatasetsApiController ¶
type DatasetsApiController struct {
// contains filtered or unexported fields
}
A DatasetsApiController binds http requests to an api service and writes the service results to the http response
func (*DatasetsApiController) CreateDataset ¶
func (c *DatasetsApiController) CreateDataset(w http.ResponseWriter, r *http.Request)
CreateDataset - Create meta info for a new dataset.
func (*DatasetsApiController) GetAllDatasets ¶
func (c *DatasetsApiController) GetAllDatasets(w http.ResponseWriter, r *http.Request)
GetAllDatasets - Get the meta info on all the datasets
func (*DatasetsApiController) GetDataset ¶
func (c *DatasetsApiController) GetDataset(w http.ResponseWriter, r *http.Request)
GetDataset - Get dataset meta information
func (*DatasetsApiController) GetDatasets ¶
func (c *DatasetsApiController) GetDatasets(w http.ResponseWriter, r *http.Request)
GetDatasets - Get the meta info on all the datasets owned by user
func (*DatasetsApiController) Routes ¶
func (c *DatasetsApiController) Routes() Routes
Routes returns all of the api route for the DatasetsApiController
func (*DatasetsApiController) UpdateDataset ¶
func (c *DatasetsApiController) UpdateDataset(w http.ResponseWriter, r *http.Request)
UpdateDataset - Update meta info for a given dataset
type DatasetsApiRouter ¶
type DatasetsApiRouter interface { CreateDataset(http.ResponseWriter, *http.Request) GetAllDatasets(http.ResponseWriter, *http.Request) GetDataset(http.ResponseWriter, *http.Request) GetDatasets(http.ResponseWriter, *http.Request) UpdateDataset(http.ResponseWriter, *http.Request) }
DatasetsApiRouter defines the required methods for binding the api requests to a responses for the DatasetsApi The DatasetsApiRouter implementation should parse necessary information from the http request, pass the data to a DatasetsApiServicer to perform the required actions, then write the service results to the http response.
type DatasetsApiServicer ¶
type DatasetsApiServicer interface { CreateDataset(context.Context, string, DatasetInfo) (ImplResponse, error) GetAllDatasets(context.Context, int32) (ImplResponse, error) GetDataset(context.Context, string, string) (ImplResponse, error) GetDatasets(context.Context, string, int32) (ImplResponse, error) UpdateDataset(context.Context, string, string, DatasetInfo) (ImplResponse, error) }
DatasetsApiServicer defines the api actions for the DatasetsApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type Design ¶
type Design struct { Name string `json:"name"` Description string `json:"description,omitempty"` Id string `json:"id"` UserId string `json:"userId,omitempty"` Schemas []DesignSchema `json:"schemas"` }
Design - Design template details along with all the schemas.
type DesignCodesApiController ¶
type DesignCodesApiController struct {
// contains filtered or unexported fields
}
A DesignCodesApiController binds http requests to an api service and writes the service results to the http response
func (*DesignCodesApiController) CreateDesignCode ¶
func (c *DesignCodesApiController) CreateDesignCode(w http.ResponseWriter, r *http.Request)
CreateDesignCode - Upload a new design code
func (*DesignCodesApiController) GetDesignCode ¶
func (c *DesignCodesApiController) GetDesignCode(w http.ResponseWriter, r *http.Request)
GetDesignCode - Get a zipped design code file owned by user
func (*DesignCodesApiController) Routes ¶
func (c *DesignCodesApiController) Routes() Routes
Routes returns all of the api route for the DesignCodesApiController
func (*DesignCodesApiController) UpdateDesignCode ¶
func (c *DesignCodesApiController) UpdateDesignCode(w http.ResponseWriter, r *http.Request)
UpdateDesignCode - Update a design code
type DesignCodesApiRouter ¶
type DesignCodesApiRouter interface { CreateDesignCode(http.ResponseWriter, *http.Request) GetDesignCode(http.ResponseWriter, *http.Request) UpdateDesignCode(http.ResponseWriter, *http.Request) }
DesignCodesApiRouter defines the required methods for binding the api requests to a responses for the DesignCodesApi The DesignCodesApiRouter implementation should parse necessary information from the http request, pass the data to a DesignCodesApiServicer to perform the required actions, then write the service results to the http response.
type DesignCodesApiServicer ¶
type DesignCodesApiServicer interface { CreateDesignCode(context.Context, string, string, string, string, *os.File) (ImplResponse, error) GetDesignCode(context.Context, string, string, string) (ImplResponse, error) UpdateDesignCode(context.Context, string, string, string, string, string, *os.File) (ImplResponse, error) }
DesignCodesApiServicer defines the api actions for the DesignCodesApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type DesignInfo ¶
type DesignInfo struct { Name string `json:"name"` Description string `json:"description,omitempty"` Id string `json:"id"` UserId string `json:"userId,omitempty"` }
DesignInfo - Only basic desgin information.
type DesignSchema ¶
type DesignSchema struct { Version string `json:"version"` Name string `json:"name"` Description string `json:"description,omitempty"` Roles []Role `json:"roles"` Channels []Channel `json:"channels"` Connectors []Connector `json:"connectors,omitempty"` }
DesignSchema - Schema to define the roles and their connections
type DesignSchemas ¶
type DesignSchemas struct {
Schemas []DesignSchema `json:"schemas"`
}
DesignSchemas - A collection of design schemas related to design template
type DesignSchemasApiController ¶
type DesignSchemasApiController struct {
// contains filtered or unexported fields
}
A DesignSchemasApiController binds http requests to an api service and writes the service results to the http response
func (*DesignSchemasApiController) CreateDesignSchema ¶
func (c *DesignSchemasApiController) CreateDesignSchema(w http.ResponseWriter, r *http.Request)
CreateDesignSchema - Update a design schema
func (*DesignSchemasApiController) GetDesignSchema ¶
func (c *DesignSchemasApiController) GetDesignSchema(w http.ResponseWriter, r *http.Request)
GetDesignSchema - Get a design schema owned by user
func (*DesignSchemasApiController) GetDesignSchemas ¶
func (c *DesignSchemasApiController) GetDesignSchemas(w http.ResponseWriter, r *http.Request)
GetDesignSchemas - Get all design schemas in a design
func (*DesignSchemasApiController) Routes ¶
func (c *DesignSchemasApiController) Routes() Routes
Routes returns all of the api route for the DesignSchemasApiController
func (*DesignSchemasApiController) UpdateDesignSchema ¶
func (c *DesignSchemasApiController) UpdateDesignSchema(w http.ResponseWriter, r *http.Request)
UpdateDesignSchema - Update a schema for a given design
type DesignSchemasApiRouter ¶
type DesignSchemasApiRouter interface { CreateDesignSchema(http.ResponseWriter, *http.Request) GetDesignSchema(http.ResponseWriter, *http.Request) GetDesignSchemas(http.ResponseWriter, *http.Request) UpdateDesignSchema(http.ResponseWriter, *http.Request) }
DesignSchemasApiRouter defines the required methods for binding the api requests to a responses for the DesignSchemasApi The DesignSchemasApiRouter implementation should parse necessary information from the http request, pass the data to a DesignSchemasApiServicer to perform the required actions, then write the service results to the http response.
type DesignSchemasApiServicer ¶
type DesignSchemasApiServicer interface { CreateDesignSchema(context.Context, string, string, DesignSchema) (ImplResponse, error) GetDesignSchema(context.Context, string, string, string) (ImplResponse, error) GetDesignSchemas(context.Context, string, string) (ImplResponse, error) UpdateDesignSchema(context.Context, string, string, string, DesignSchema) (ImplResponse, error) }
DesignSchemasApiServicer defines the api actions for the DesignSchemasApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type DesignsApiController ¶
type DesignsApiController struct {
// contains filtered or unexported fields
}
A DesignsApiController binds http requests to an api service and writes the service results to the http response
func (*DesignsApiController) CreateDesign ¶
func (c *DesignsApiController) CreateDesign(w http.ResponseWriter, r *http.Request)
CreateDesign - Create a new design template.
func (*DesignsApiController) GetDesign ¶
func (c *DesignsApiController) GetDesign(w http.ResponseWriter, r *http.Request)
GetDesign - Get design template information
func (*DesignsApiController) GetDesigns ¶
func (c *DesignsApiController) GetDesigns(w http.ResponseWriter, r *http.Request)
GetDesigns - Get list of all the designs created by the user.
func (*DesignsApiController) Routes ¶
func (c *DesignsApiController) Routes() Routes
Routes returns all of the api route for the DesignsApiController
type DesignsApiRouter ¶
type DesignsApiRouter interface { CreateDesign(http.ResponseWriter, *http.Request) GetDesign(http.ResponseWriter, *http.Request) GetDesigns(http.ResponseWriter, *http.Request) }
DesignsApiRouter defines the required methods for binding the api requests to a responses for the DesignsApi The DesignsApiRouter implementation should parse necessary information from the http request, pass the data to a DesignsApiServicer to perform the required actions, then write the service results to the http response.
type DesignsApiServicer ¶
type DesignsApiServicer interface { CreateDesign(context.Context, string, DesignInfo) (ImplResponse, error) GetDesign(context.Context, string, string) (ImplResponse, error) GetDesigns(context.Context, string, int32) (ImplResponse, error) }
DesignsApiServicer defines the api actions for the DesignsApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)
ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if you would like errors to be handled differently from the DefaultErrorHandler
type ImplResponse ¶
type ImplResponse struct { Code int Body interface{} }
Implementation response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
type JobPriority ¶
type JobPriority string
const ( LOW JobPriority = "low" MEDIUM JobPriority = "medium" HIGH JobPriority = "high" )
List of JobPriority
type JobSpec ¶
type JobSpec struct { Id string `json:"id,omitempty"` UserId string `json:"userId,omitempty"` DesignId string `json:"designId"` SchemaVersion string `json:"schemaVersion"` CodeVersion string `json:"codeVersion"` DataSpec DataSpec `json:"dataSpec,omitempty"` Optimizer Optimizer `json:"optimizer,omitempty"` Selector Selector `json:"selector,omitempty"` Priority JobPriority `json:"priority,omitempty"` Backend CommBackend `json:"backend,omitempty"` MaxRunTime int32 `json:"maxRunTime,omitempty"` BaseModel BaseModel `json:"baseModel,omitempty"` Hyperparameters map[string]interface{} `json:"hyperparameters,omitempty"` Dependencies []string `json:"dependencies,omitempty"` }
JobSpec - Job specification
type JobState ¶
type JobState string
const ( READY JobState = "ready" STARTING JobState = "starting" APPLYING JobState = "applying" DEPLOYING JobState = "deploying" STOPPING JobState = "stopping" RUNNING JobState = "running" FAILED JobState = "failed" TERMINATED JobState = "terminated" COMPLETED JobState = "completed" )
List of JobState
type JobStatus ¶
type JobStatus struct { Id string `json:"id"` State JobState `json:"state"` CreatedAt time.Time `json:"createdAt,omitempty"` StartedAt time.Time `json:"startedAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` EndedAt time.Time `json:"endedAt,omitempty"` }
JobStatus - Job status
type JobsApiController ¶
type JobsApiController struct {
// contains filtered or unexported fields
}
JobsApiController binds http requests to an api service and writes the service results to the http response
func (*JobsApiController) CreateJob ¶
func (c *JobsApiController) CreateJob(w http.ResponseWriter, r *http.Request)
CreateJob - Create a new job specification
func (*JobsApiController) DeleteJob ¶
func (c *JobsApiController) DeleteJob(w http.ResponseWriter, r *http.Request)
DeleteJob - Delete job specification
func (*JobsApiController) GetJob ¶
func (c *JobsApiController) GetJob(w http.ResponseWriter, r *http.Request)
GetJob - Get a job specification
func (*JobsApiController) GetJobStatus ¶
func (c *JobsApiController) GetJobStatus(w http.ResponseWriter, r *http.Request)
GetJobStatus - Get job status of a given jobId
func (*JobsApiController) GetJobs ¶
func (c *JobsApiController) GetJobs(w http.ResponseWriter, r *http.Request)
GetJobs - Get status info on all the jobs owned by user
func (*JobsApiController) GetTask ¶
func (c *JobsApiController) GetTask(w http.ResponseWriter, r *http.Request)
GetTask - Get a job task for a given job and task
func (*JobsApiController) GetTaskInfo ¶ added in v0.1.2
func (c *JobsApiController) GetTaskInfo(w http.ResponseWriter, r *http.Request)
GetTaskInfo - Get the info of a task in a job
func (*JobsApiController) GetTasksInfo ¶
func (c *JobsApiController) GetTasksInfo(w http.ResponseWriter, r *http.Request)
GetTasksInfo - Get the info of tasks in a job
func (*JobsApiController) Routes ¶
func (c *JobsApiController) Routes() Routes
Routes returns all of the api route for the JobsApiController
func (*JobsApiController) UpdateJob ¶
func (c *JobsApiController) UpdateJob(w http.ResponseWriter, r *http.Request)
UpdateJob - Update a job specification
func (*JobsApiController) UpdateJobStatus ¶
func (c *JobsApiController) UpdateJobStatus(w http.ResponseWriter, r *http.Request)
UpdateJobStatus - Update the status of a job
func (*JobsApiController) UpdateTaskStatus ¶
func (c *JobsApiController) UpdateTaskStatus(w http.ResponseWriter, r *http.Request)
UpdateTaskStatus - Update the status of a task
type JobsApiOption ¶
type JobsApiOption func(*JobsApiController)
JobsApiOption for how the controller is set up.
func WithJobsApiErrorHandler ¶
func WithJobsApiErrorHandler(h ErrorHandler) JobsApiOption
WithJobsApiErrorHandler inject ErrorHandler into controller
type JobsApiRouter ¶
type JobsApiRouter interface { CreateJob(http.ResponseWriter, *http.Request) DeleteJob(http.ResponseWriter, *http.Request) GetJob(http.ResponseWriter, *http.Request) GetJobStatus(http.ResponseWriter, *http.Request) GetJobs(http.ResponseWriter, *http.Request) GetTask(http.ResponseWriter, *http.Request) GetTaskInfo(http.ResponseWriter, *http.Request) GetTasksInfo(http.ResponseWriter, *http.Request) UpdateJob(http.ResponseWriter, *http.Request) UpdateJobStatus(http.ResponseWriter, *http.Request) UpdateTaskStatus(http.ResponseWriter, *http.Request) }
JobsApiRouter defines the required methods for binding the api requests to a responses for the JobsApi The JobsApiRouter implementation should parse necessary information from the http request, pass the data to a JobsApiServicer to perform the required actions, then write the service results to the http response.
type JobsApiServicer ¶
type JobsApiServicer interface { CreateJob(context.Context, string, JobSpec) (ImplResponse, error) DeleteJob(context.Context, string, string) (ImplResponse, error) GetJob(context.Context, string, string) (ImplResponse, error) GetJobStatus(context.Context, string, string) (ImplResponse, error) GetJobs(context.Context, string, int32) (ImplResponse, error) GetTask(context.Context, string, string, string) (ImplResponse, error) GetTaskInfo(context.Context, string, string, string) (ImplResponse, error) GetTasksInfo(context.Context, string, string, int32) (ImplResponse, error) UpdateJob(context.Context, string, string, JobSpec) (ImplResponse, error) UpdateJobStatus(context.Context, string, string, JobStatus) (ImplResponse, error) UpdateTaskStatus(context.Context, string, string, TaskStatus) (ImplResponse, error) }
JobsApiServicer defines the api actions for the JobsApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
type ParsingError ¶
type ParsingError struct {
Err error
}
ParsingError indicates that an error has occurred when parsing request parameters
func (*ParsingError) Error ¶
func (e *ParsingError) Error() string
func (*ParsingError) Unwrap ¶
func (e *ParsingError) Unwrap() error
type RequiredError ¶
type RequiredError struct {
Field string
}
RequiredError indicates that an error has occurred when parsing request parameters
func (*RequiredError) Error ¶
func (e *RequiredError) Error() string
type Role ¶
type Role struct { Name string `json:"name"` Description string `json:"description,omitempty"` IsDataConsumer bool `json:"isDataConsumer,omitempty"` Replica int32 `json:"replica,omitempty"` }
Role - Define the role of a compute unit
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewDatasetsApiController ¶
func NewDatasetsApiController(s DatasetsApiServicer) Router
NewDatasetsApiController creates a default api controller
func NewDesignCodesApiController ¶
func NewDesignCodesApiController(s DesignCodesApiServicer) Router
NewDesignCodesApiController creates a default api controller
func NewDesignSchemasApiController ¶
func NewDesignSchemasApiController(s DesignSchemasApiServicer) Router
NewDesignSchemasApiController creates a default api controller
func NewDesignsApiController ¶
func NewDesignsApiController(s DesignsApiServicer) Router
NewDesignsApiController creates a default api controller
func NewJobsApiController ¶
func NewJobsApiController(s JobsApiServicer, opts ...JobsApiOption) Router
NewJobsApiController creates a default api controller
type TaskInfo ¶
type TaskInfo struct { JobId string `json:"jobId,omitempty"` TaskId string `json:"taskId,omitempty"` Role string `json:"role,omitempty"` Type TaskType `json:"type,omitempty"` Key string `json:"key,omitempty"` State JobState `json:"state,omitempty"` Log string `json:"log,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
TaskInfo - Task information
Source Files
¶
- api.go
- api_datasets.go
- api_design_codes.go
- api_design_schemas.go
- api_designs.go
- api_jobs.go
- error.go
- helpers.go
- impl.go
- logger.go
- model_base_model.go
- model_channel.go
- model_channel_group_by.go
- model_comm_backend.go
- model_connector.go
- model_data_spec.go
- model_dataset_info.go
- model_design.go
- model_design_info.go
- model_design_schema.go
- model_design_schemas.go
- model_error.go
- model_job_priority.go
- model_job_spec.go
- model_job_state.go
- model_job_status.go
- model_optimizer.go
- model_role.go
- model_selector.go
- model_task_info.go
- model_task_status.go
- model_task_type.go
- routers.go