Documentation
¶
Index ¶
- Variables
- func AssertAgentStateRequired(obj AgentState) error
- func AssertBaseModelRequired(obj BaseModel) error
- func AssertComputeSpecRequired(obj ComputeSpec) error
- func AssertComputeStateRequired(obj ComputeState) error
- func AssertComputeStatusRequired(obj ComputeStatus) error
- func AssertDataSpecRequired(obj DataSpec) error
- func AssertDeploymentConfigRequired(obj DeploymentConfig) error
- func AssertJobSpecRequired(obj JobSpec) error
- func AssertJobStatusRequired(obj JobStatus) error
- func AssertOptimizerRequired(obj Optimizer) error
- func AssertRecurseAgentStateRequired(objSlice interface{}) error
- func AssertRecurseBaseModelRequired(objSlice interface{}) error
- func AssertRecurseComputeSpecRequired(objSlice interface{}) error
- func AssertRecurseComputeStateRequired(objSlice interface{}) error
- func AssertRecurseComputeStatusRequired(objSlice interface{}) error
- func AssertRecurseDataSpecRequired(objSlice interface{}) error
- func AssertRecurseDeploymentConfigRequired(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 AgentState
- type BaseModel
- type Channel
- type ChannelGroupBy
- type CommBackend
- type ComputeSpec
- type ComputeState
- type ComputeStatus
- type ComputesApiController
- func (c *ComputesApiController) DeleteCompute(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) GetComputeConfig(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) GetComputeStatus(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) GetDeploymentConfig(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) GetDeploymentStatus(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) GetDeployments(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) PutDeploymentStatus(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) RegisterCompute(w http.ResponseWriter, r *http.Request)
- func (c *ComputesApiController) Routes() Routes
- func (c *ComputesApiController) UpdateCompute(w http.ResponseWriter, r *http.Request)
- type ComputesApiOption
- type ComputesApiRouter
- type ComputesApiServicer
- 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 DeploymentConfig
- type Design
- type DesignCodesApiController
- func (c *DesignCodesApiController) CreateDesignCode(w http.ResponseWriter, r *http.Request)
- func (c *DesignCodesApiController) DeleteDesignCode(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) DeleteDesignSchema(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
- func (c *DesignsApiController) CreateDesign(w http.ResponseWriter, r *http.Request)
- func (c *DesignsApiController) DeleteDesign(w http.ResponseWriter, r *http.Request)
- func (c *DesignsApiController) GetDesign(w http.ResponseWriter, r *http.Request)
- func (c *DesignsApiController) GetDesigns(w http.ResponseWriter, r *http.Request)
- func (c *DesignsApiController) Routes() Routes
- 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 NewComputesApiController(s ComputesApiServicer, opts ...ComputesApiOption) 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 AssertAgentStateRequired ¶ added in v0.1.5
func AssertAgentStateRequired(obj AgentState) error
AssertAgentStateRequired checks if the required fields are not zero-ed
func AssertBaseModelRequired ¶ added in v0.1.5
AssertBaseModelRequired checks if the required fields are not zero-ed
func AssertComputeSpecRequired ¶ added in v0.1.5
func AssertComputeSpecRequired(obj ComputeSpec) error
AssertComputeSpecRequired checks if the required fields are not zero-ed
func AssertComputeStateRequired ¶ added in v0.1.5
func AssertComputeStateRequired(obj ComputeState) error
AssertComputeStateRequired checks if the required fields are not zero-ed
func AssertComputeStatusRequired ¶ added in v0.1.5
func AssertComputeStatusRequired(obj ComputeStatus) error
AssertComputeStatusRequired checks if the required fields are not zero-ed
func AssertDataSpecRequired ¶
AssertDataSpecRequired checks if the required fields are not zero-ed
func AssertDeploymentConfigRequired ¶ added in v0.1.5
func AssertDeploymentConfigRequired(obj DeploymentConfig) error
AssertDeploymentConfigRequired 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 AssertRecurseAgentStateRequired ¶ added in v0.1.5
func AssertRecurseAgentStateRequired(objSlice interface{}) error
AssertRecurseAgentStateRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of AgentState (e.g. [][]AgentState), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseBaseModelRequired ¶ added in v0.1.5
func AssertRecurseBaseModelRequired(objSlice interface{}) error
AssertRecurseBaseModelRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of BaseModel (e.g. [][]BaseModel), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseComputeSpecRequired ¶ added in v0.1.5
func AssertRecurseComputeSpecRequired(objSlice interface{}) error
AssertRecurseComputeSpecRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ComputeSpec (e.g. [][]ComputeSpec), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseComputeStateRequired ¶ added in v0.1.5
func AssertRecurseComputeStateRequired(objSlice interface{}) error
AssertRecurseComputeStateRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ComputeState (e.g. [][]ComputeState), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseComputeStatusRequired ¶ added in v0.1.5
func AssertRecurseComputeStatusRequired(objSlice interface{}) error
AssertRecurseComputeStatusRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ComputeStatus (e.g. [][]ComputeStatus), otherwise ErrTypeAssertionError is thrown.
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 AssertRecurseDeploymentConfigRequired ¶ added in v0.1.5
func AssertRecurseDeploymentConfigRequired(objSlice interface{}) error
AssertRecurseDeploymentConfigRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of DeploymentConfig (e.g. [][]DeploymentConfig), 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 AgentState ¶ added in v0.1.5
type AgentState string
const ( AGENT_DEPLOY_SUCCESS AgentState = "agentDeploySuccess" AGENT_DEPLOY_FAILED AgentState = "agentDeployFailed" AGENT_REVOKE_SUCCESS AgentState = "agentRevokeSuccess" AGENT_REVOKE_FAILED AgentState = "agentRevokeFailed" )
List of AgentState
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 ComputeSpec ¶ added in v0.1.5
type ComputeSpec struct { AdminId string `json:"adminId,omitempty"` Region string `json:"region,omitempty"` ApiKey string `json:"apiKey,omitempty"` ComputeId string `json:"computeId,omitempty"` }
ComputeSpec - Compute specification
type ComputeState ¶ added in v0.1.5
type ComputeState string
const ( UP ComputeState = "up" DOWN ComputeState = "down" MAINTENANCE ComputeState = "maintenance" )
List of ComputeState
type ComputeStatus ¶ added in v0.1.5
type ComputeStatus struct { ComputeId string `json:"computeId"` RegisteredAt time.Time `json:"registeredAt,omitempty"` State ComputeState `json:"state"` UpdatedAt time.Time `json:"updatedAt,omitempty"` }
ComputeStatus - Cluster compute status
type ComputesApiController ¶ added in v0.1.5
type ComputesApiController struct {
// contains filtered or unexported fields
}
ComputesApiController binds http requests to an api service and writes the service results to the http response
func (*ComputesApiController) DeleteCompute ¶ added in v0.1.5
func (c *ComputesApiController) DeleteCompute(w http.ResponseWriter, r *http.Request)
DeleteCompute - Delete compute cluster specification
func (*ComputesApiController) GetComputeConfig ¶ added in v0.1.5
func (c *ComputesApiController) GetComputeConfig(w http.ResponseWriter, r *http.Request)
GetComputeConfig - Get configuration for a compute cluster
func (*ComputesApiController) GetComputeStatus ¶ added in v0.1.5
func (c *ComputesApiController) GetComputeStatus(w http.ResponseWriter, r *http.Request)
GetComputeStatus - Get status of a given compute cluster
func (*ComputesApiController) GetDeploymentConfig ¶ added in v0.1.5
func (c *ComputesApiController) GetDeploymentConfig(w http.ResponseWriter, r *http.Request)
GetDeploymentConfig - Get the deployment config for a job for a compute cluster
func (*ComputesApiController) GetDeploymentStatus ¶ added in v0.1.5
func (c *ComputesApiController) GetDeploymentStatus(w http.ResponseWriter, r *http.Request)
GetDeploymentStatus - Get the deployment status for a job on a compute cluster
func (*ComputesApiController) GetDeployments ¶ added in v0.1.5
func (c *ComputesApiController) GetDeployments(w http.ResponseWriter, r *http.Request)
GetDeployments - Get all deployments within a compute cluster
func (*ComputesApiController) PutDeploymentStatus ¶ added in v0.1.5
func (c *ComputesApiController) PutDeploymentStatus(w http.ResponseWriter, r *http.Request)
PutDeploymentStatus - Add or update the deployment status for a job on a compute cluster
func (*ComputesApiController) RegisterCompute ¶ added in v0.1.5
func (c *ComputesApiController) RegisterCompute(w http.ResponseWriter, r *http.Request)
RegisterCompute - Register a new compute cluster
func (*ComputesApiController) Routes ¶ added in v0.1.5
func (c *ComputesApiController) Routes() Routes
Routes returns all of the api route for the ComputesApiController
func (*ComputesApiController) UpdateCompute ¶ added in v0.1.5
func (c *ComputesApiController) UpdateCompute(w http.ResponseWriter, r *http.Request)
UpdateCompute - Update a compute cluster's specification
type ComputesApiOption ¶ added in v0.1.5
type ComputesApiOption func(*ComputesApiController)
ComputesApiOption for how the controller is set up.
func WithComputesApiErrorHandler ¶ added in v0.1.5
func WithComputesApiErrorHandler(h ErrorHandler) ComputesApiOption
WithComputesApiErrorHandler inject ErrorHandler into controller
type ComputesApiRouter ¶ added in v0.1.5
type ComputesApiRouter interface { DeleteCompute(http.ResponseWriter, *http.Request) GetComputeConfig(http.ResponseWriter, *http.Request) GetComputeStatus(http.ResponseWriter, *http.Request) GetDeploymentConfig(http.ResponseWriter, *http.Request) GetDeploymentStatus(http.ResponseWriter, *http.Request) GetDeployments(http.ResponseWriter, *http.Request) PutDeploymentStatus(http.ResponseWriter, *http.Request) RegisterCompute(http.ResponseWriter, *http.Request) UpdateCompute(http.ResponseWriter, *http.Request) }
ComputesApiRouter defines the required methods for binding the api requests to a responses for the ComputesApi The ComputesApiRouter implementation should parse necessary information from the http request, pass the data to a ComputesApiServicer to perform the required actions, then write the service results to the http response.
type ComputesApiServicer ¶ added in v0.1.5
type ComputesApiServicer interface { DeleteCompute(context.Context, string, string) (ImplResponse, error) GetComputeConfig(context.Context, string, string) (ImplResponse, error) GetComputeStatus(context.Context, string, string) (ImplResponse, error) GetDeploymentConfig(context.Context, string, string, string) (ImplResponse, error) GetDeploymentStatus(context.Context, string, string, string) (ImplResponse, error) GetDeployments(context.Context, string, string) (ImplResponse, error) PutDeploymentStatus(context.Context, string, string, string, map[string]AgentState) (ImplResponse, error) RegisterCompute(context.Context, ComputeSpec) (ImplResponse, error) UpdateCompute(context.Context, string, string, ComputeSpec) (ImplResponse, error) }
ComputesApiServicer defines the api actions for the ComputesApi 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 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"` ComputeId string `json:"computeId,omitempty"` 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 DeploymentConfig ¶ added in v0.1.5
type DeploymentConfig struct { JobId string `json:"jobId"` ImageLoc string `json:"imageLoc"` // Config for agents in the deployment AgentKVs map[string]string `json:"agentKVs"` }
DeploymentConfig - Deployment config for agents
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) DeleteDesignCode ¶ added in v0.1.6
func (c *DesignCodesApiController) DeleteDesignCode(w http.ResponseWriter, r *http.Request)
DeleteDesignCode - Delete code of a specified version from a given design
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) DeleteDesignCode(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) DeleteDesignCode(context.Context, string, string, string) (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) DeleteDesignSchema ¶ added in v0.1.6
func (c *DesignSchemasApiController) DeleteDesignSchema(w http.ResponseWriter, r *http.Request)
DeleteDesignSchema - Delete a schema for a given design
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) DeleteDesignSchema(context.Context, string, string, string) (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) DeleteDesign ¶ added in v0.1.6
func (c *DesignsApiController) DeleteDesign(w http.ResponseWriter, r *http.Request)
DeleteDesign - Delete 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) DeleteDesign(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) DeleteDesign(context.Context, string, string) (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 NewComputesApiController ¶ added in v0.1.5
func NewComputesApiController(s ComputesApiServicer, opts ...ComputesApiOption) Router
NewComputesApiController creates a default api controller
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"` ComputeId string `json:"computeId,omitempty"` Log string `json:"log,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
TaskInfo - Task information
Source Files
¶
- api.go
- api_computes.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_agent_state.go
- model_base_model.go
- model_channel.go
- model_channel_group_by.go
- model_comm_backend.go
- model_compute_spec.go
- model_compute_state.go
- model_compute_status.go
- model_connector.go
- model_data_spec.go
- model_dataset_info.go
- model_deployment_config.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