openapi

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func AssertBaseModelRequired(obj BaseModel) error

AssertBaseModelRequired checks if the required fields are not zero-ed

func AssertBasicJobInfoRequired added in v0.2.2

func AssertBasicJobInfoRequired(obj BasicJobInfo) error

AssertBasicJobInfoRequired checks if the required fields are not zero-ed

func AssertChannelGroupByRequired added in v0.2.1

func AssertChannelGroupByRequired(obj ChannelGroupBy) error

AssertChannelGroupByRequired checks if the required fields are not zero-ed

func AssertChannelRequired added in v0.2.1

func AssertChannelRequired(obj Channel) error

AssertChannelRequired checks if the required fields are not zero-ed

func AssertCodeApiResponseConstraints added in v0.3.0

func AssertCodeApiResponseConstraints(obj CodeApiResponse) error

AssertCodeApiResponseConstraints checks if the values respects the defined constraints

func AssertCodeApiResponseRequired added in v0.3.0

func AssertCodeApiResponseRequired(obj CodeApiResponse) error

AssertCodeApiResponseRequired checks if the required fields are not zero-ed

func AssertCommBackendRequired added in v0.2.1

func AssertCommBackendRequired(obj CommBackend) error

AssertCommBackendRequired 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 AssertConnectorRequired added in v0.2.1

func AssertConnectorRequired(obj Connector) error

AssertConnectorRequired checks if the required fields are not zero-ed

func AssertDatasetInfoRequired added in v0.2.1

func AssertDatasetInfoRequired(obj DatasetInfo) error

AssertDatasetInfoRequired 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 AssertDesignConstraints added in v0.3.0

func AssertDesignConstraints(obj Design) error

AssertDesignConstraints checks if the values respects the defined constraints

func AssertDesignInfoRequired added in v0.2.1

func AssertDesignInfoRequired(obj DesignInfo) error

AssertDesignInfoRequired checks if the required fields are not zero-ed

func AssertDesignRequired added in v0.2.1

func AssertDesignRequired(obj Design) error

AssertDesignRequired checks if the required fields are not zero-ed

func AssertDesignSchemaConstraints added in v0.3.0

func AssertDesignSchemaConstraints(obj DesignSchema) error

AssertDesignSchemaConstraints checks if the values respects the defined constraints

func AssertDesignSchemaRequired added in v0.2.1

func AssertDesignSchemaRequired(obj DesignSchema) error

AssertDesignSchemaRequired checks if the required fields are not zero-ed

func AssertErrorRequired added in v0.2.1

func AssertErrorRequired(obj Error) error

AssertErrorRequired checks if the required fields are not zero-ed

func AssertJobPriorityRequired added in v0.2.1

func AssertJobPriorityRequired(obj JobPriority) error

AssertJobPriorityRequired checks if the required fields are not zero-ed

func AssertJobSpecConstraints added in v0.3.0

func AssertJobSpecConstraints(obj JobSpec) error

AssertJobSpecConstraints checks if the values respects the defined constraints

func AssertJobSpecRequired

func AssertJobSpecRequired(obj JobSpec) error

AssertJobSpecRequired checks if the required fields are not zero-ed

func AssertJobStateRequired added in v0.2.1

func AssertJobStateRequired(obj JobState) error

AssertJobStateRequired checks if the required fields are not zero-ed

func AssertJobStatusRequired added in v0.1.2

func AssertJobStatusRequired(obj JobStatus) error

AssertJobStatusRequired checks if the required fields are not zero-ed

func AssertModelSpecRequired added in v0.2.2

func AssertModelSpecRequired(obj ModelSpec) error

AssertModelSpecRequired checks if the required fields are not zero-ed

func AssertOptimizerRequired added in v0.1.2

func AssertOptimizerRequired(obj Optimizer) error

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 AssertRecurseBasicJobInfoRequired added in v0.2.2

func AssertRecurseBasicJobInfoRequired(objSlice interface{}) error

AssertRecurseBasicJobInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of BasicJobInfo (e.g. [][]BasicJobInfo), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseChannelGroupByRequired added in v0.2.1

func AssertRecurseChannelGroupByRequired(objSlice interface{}) error

AssertRecurseChannelGroupByRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ChannelGroupBy (e.g. [][]ChannelGroupBy), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseChannelRequired added in v0.2.1

func AssertRecurseChannelRequired(objSlice interface{}) error

AssertRecurseChannelRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Channel (e.g. [][]Channel), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseCommBackendRequired added in v0.2.1

func AssertRecurseCommBackendRequired(objSlice interface{}) error

AssertRecurseCommBackendRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of CommBackend (e.g. [][]CommBackend), 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 AssertRecurseConnectorRequired added in v0.2.1

func AssertRecurseConnectorRequired(objSlice interface{}) error

AssertRecurseConnectorRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Connector (e.g. [][]Connector), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseDatasetInfoRequired added in v0.2.1

func AssertRecurseDatasetInfoRequired(objSlice interface{}) error

AssertRecurseDatasetInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of DatasetInfo (e.g. [][]DatasetInfo), 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 AssertRecurseDesignInfoRequired added in v0.2.1

func AssertRecurseDesignInfoRequired(objSlice interface{}) error

AssertRecurseDesignInfoRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of DesignInfo (e.g. [][]DesignInfo), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseErrorRequired added in v0.2.1

func AssertRecurseErrorRequired(objSlice interface{}) error

AssertRecurseErrorRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Error (e.g. [][]Error), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseInterfaceRequired

func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error

AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a preorder fashion.

func AssertRecurseJobPriorityRequired added in v0.2.1

func AssertRecurseJobPriorityRequired(objSlice interface{}) error

AssertRecurseJobPriorityRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of JobPriority (e.g. [][]JobPriority), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseJobStateRequired added in v0.2.1

func AssertRecurseJobStateRequired(objSlice interface{}) error

AssertRecurseJobStateRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of JobState (e.g. [][]JobState), 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 AssertRecurseModelSpecRequired added in v0.2.2

func AssertRecurseModelSpecRequired(objSlice interface{}) error

AssertRecurseModelSpecRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ModelSpec (e.g. [][]ModelSpec), 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 AssertRecurseRoleDatasetGroupsRequired added in v0.2.3

func AssertRecurseRoleDatasetGroupsRequired(objSlice interface{}) error

AssertRecurseRoleDatasetGroupsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of RoleDatasetGroups (e.g. [][]RoleDatasetGroups), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseRoleRequired added in v0.2.1

func AssertRecurseRoleRequired(objSlice interface{}) error

AssertRecurseRoleRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Role (e.g. [][]Role), 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 AssertRecurseValueRequired

func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error

AssertRecurseValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a preorder fashion.

func AssertRoleDatasetGroupsRequired added in v0.2.3

func AssertRoleDatasetGroupsRequired(obj RoleDatasetGroups) error

AssertRoleDatasetGroupsRequired checks if the required fields are not zero-ed

func AssertRoleRequired added in v0.2.1

func AssertRoleRequired(obj Role) error

AssertRoleRequired checks if the required fields are not zero-ed

func AssertSelectorRequired

func AssertSelectorRequired(obj Selector) error

AssertSelectorRequired checks if the required fields are not zero-ed

func AssertTaskInfoRequired

func AssertTaskInfoRequired(obj TaskInfo) error

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 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 service 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 Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter(routers ...Router) *mux.Router

NewRouter creates a new router for any number of api routers

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

func ReadFormFilesToTempFiles

func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)

ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files

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 BaseModel

type BaseModel struct {
	Name string `json:"name,omitempty"`

	Version int32 `json:"version,omitempty"`
}

type BasicJobInfo added in v0.2.2

type BasicJobInfo struct {
	Id            string      `json:"id,omitempty"`
	UserId        string      `json:"userId,omitempty"`
	DesignId      string      `json:"designId"`
	SchemaVersion string      `json:"schemaVersion"`
	CodeVersion   string      `json:"codeVersion"`
	Priority      JobPriority `json:"priority,omitempty"`
	MaxRunTime    int32       `json:"maxRunTime,omitempty"`
}

BasicJobInfo - Basic Job specification

type Channel

type Channel struct {
	Name string `json:"name"`

	Backend CommBackend `json:"backend,omitempty"`

	BrokerHost string `json:"brokerHost,omitempty"`

	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 ChannelGroupBy struct {
	Type string `json:"type"`

	Value []string `json:"value"`
}

type CodeApiResponse added in v0.3.0

type CodeApiResponse struct {
	Revision int32 `json:"revision"`
}

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 the api routes 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 be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type Connector

type Connector struct {
	Name string `json:"name"`

	Description string `json:"description,omitempty"`

	Connection map[string]interface{} `json:"connection"`
}

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
}

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 the api routes 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 DatasetsApiOption added in v0.2.1

type DatasetsApiOption func(*DatasetsApiController)

DatasetsApiOption for how the controller is set up.

func WithDatasetsApiErrorHandler added in v0.2.1

func WithDatasetsApiErrorHandler(h ErrorHandler) DatasetsApiOption

WithDatasetsApiErrorHandler inject ErrorHandler into controller

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 be 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 {
	Schema DesignSchema `json:"schema,omitempty"`

	Name string `json:"name,omitempty"`

	Description string `json:"description,omitempty"`

	Id string `json:"id"`

	UserId string `json:"userId,omitempty"`
}

Design - Design template details along with a schema.

type DesignCodeApiController added in v0.3.0

type DesignCodeApiController struct {
	// contains filtered or unexported fields
}

DesignCodeApiController binds http requests to an api service and writes the service results to the http response

func (*DesignCodeApiController) CreateDesignCode added in v0.3.0

func (c *DesignCodeApiController) CreateDesignCode(w http.ResponseWriter, r *http.Request)

CreateDesignCode - Upload a new design code

func (*DesignCodeApiController) DeleteDesignCode added in v0.3.0

func (c *DesignCodeApiController) DeleteDesignCode(w http.ResponseWriter, r *http.Request)

DeleteDesignCode - Delete code of a given design

func (*DesignCodeApiController) GetDesignCode added in v0.3.0

func (c *DesignCodeApiController) GetDesignCode(w http.ResponseWriter, r *http.Request)

GetDesignCode - Get a zipped design code file owned by user

func (*DesignCodeApiController) GetDesignCodeRevision added in v0.3.0

func (c *DesignCodeApiController) GetDesignCodeRevision(w http.ResponseWriter, r *http.Request)

GetDesignCodeRevision - Get a revision number of design code

func (*DesignCodeApiController) Routes added in v0.3.0

func (c *DesignCodeApiController) Routes() Routes

Routes returns all the api routes for the DesignCodeApiController

func (*DesignCodeApiController) UpdateDesignCode added in v0.3.0

func (c *DesignCodeApiController) UpdateDesignCode(w http.ResponseWriter, r *http.Request)

UpdateDesignCode - Update a design code

type DesignCodeApiOption added in v0.3.0

type DesignCodeApiOption func(*DesignCodeApiController)

DesignCodeApiOption for how the controller is set up.

func WithDesignCodeApiErrorHandler added in v0.3.0

func WithDesignCodeApiErrorHandler(h ErrorHandler) DesignCodeApiOption

WithDesignCodeApiErrorHandler inject ErrorHandler into controller

type DesignCodeApiRouter added in v0.3.0

type DesignCodeApiRouter interface {
	CreateDesignCode(http.ResponseWriter, *http.Request)
	DeleteDesignCode(http.ResponseWriter, *http.Request)
	GetDesignCode(http.ResponseWriter, *http.Request)
	GetDesignCodeRevision(http.ResponseWriter, *http.Request)
	UpdateDesignCode(http.ResponseWriter, *http.Request)
}

DesignCodeApiRouter defines the required methods for binding the api requests to a responses for the DesignCodeApi The DesignCodeApiRouter implementation should parse necessary information from the http request, pass the data to a DesignCodeApiServicer to perform the required actions, then write the service results to the http response.

type DesignCodeApiServicer added in v0.3.0

type DesignCodeApiServicer interface {
	CreateDesignCode(context.Context, string, string, string, *os.File) (ImplResponse, error)
	DeleteDesignCode(context.Context, string, string) (ImplResponse, error)
	GetDesignCode(context.Context, string, string) (ImplResponse, error)
	GetDesignCodeRevision(context.Context, string, string) (ImplResponse, error)
	UpdateDesignCode(context.Context, string, string, string, *os.File) (ImplResponse, error)
}

DesignCodeApiServicer defines the api actions for the DesignCodeApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be 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 {
	Revision int32 `json:"revision,omitempty"`

	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 DesignSchemaApiController added in v0.3.0

type DesignSchemaApiController struct {
	// contains filtered or unexported fields
}

DesignSchemaApiController binds http requests to an api service and writes the service results to the http response

func (*DesignSchemaApiController) CreateDesignSchema added in v0.3.0

func (c *DesignSchemaApiController) CreateDesignSchema(w http.ResponseWriter, r *http.Request)

CreateDesignSchema - Update a design schema

func (*DesignSchemaApiController) DeleteDesignSchema added in v0.3.0

func (c *DesignSchemaApiController) DeleteDesignSchema(w http.ResponseWriter, r *http.Request)

DeleteDesignSchema - Delete a schema for a given design

func (*DesignSchemaApiController) GetDesignSchema added in v0.3.0

func (c *DesignSchemaApiController) GetDesignSchema(w http.ResponseWriter, r *http.Request)

GetDesignSchema - Get a design schema owned by user

func (*DesignSchemaApiController) Routes added in v0.3.0

func (c *DesignSchemaApiController) Routes() Routes

Routes returns all the api routes for the DesignSchemaApiController

func (*DesignSchemaApiController) UpdateDesignSchema added in v0.3.0

func (c *DesignSchemaApiController) UpdateDesignSchema(w http.ResponseWriter, r *http.Request)

UpdateDesignSchema - Update a schema for a given design

type DesignSchemaApiOption added in v0.3.0

type DesignSchemaApiOption func(*DesignSchemaApiController)

DesignSchemaApiOption for how the controller is set up.

func WithDesignSchemaApiErrorHandler added in v0.3.0

func WithDesignSchemaApiErrorHandler(h ErrorHandler) DesignSchemaApiOption

WithDesignSchemaApiErrorHandler inject ErrorHandler into controller

type DesignSchemaApiRouter added in v0.3.0

type DesignSchemaApiRouter interface {
	CreateDesignSchema(http.ResponseWriter, *http.Request)
	DeleteDesignSchema(http.ResponseWriter, *http.Request)
	GetDesignSchema(http.ResponseWriter, *http.Request)
	UpdateDesignSchema(http.ResponseWriter, *http.Request)
}

DesignSchemaApiRouter defines the required methods for binding the api requests to a responses for the DesignSchemaApi The DesignSchemaApiRouter implementation should parse necessary information from the http request, pass the data to a DesignSchemaApiServicer to perform the required actions, then write the service results to the http response.

type DesignSchemaApiServicer added in v0.3.0

type DesignSchemaApiServicer interface {
	CreateDesignSchema(context.Context, string, string, DesignSchema) (ImplResponse, error)
	DeleteDesignSchema(context.Context, string, string) (ImplResponse, error)
	GetDesignSchema(context.Context, string, string) (ImplResponse, error)
	UpdateDesignSchema(context.Context, string, string, DesignSchema) (ImplResponse, error)
}

DesignSchemaApiServicer defines the api actions for the DesignSchemaApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be 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
}

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 the api routes for the DesignsApiController

type DesignsApiOption added in v0.2.1

type DesignsApiOption func(*DesignsApiController)

DesignsApiOption for how the controller is set up.

func WithDesignsApiErrorHandler added in v0.2.1

func WithDesignsApiErrorHandler(h ErrorHandler) DesignsApiOption

WithDesignsApiErrorHandler inject ErrorHandler into controller

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 be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type Error

type Error struct {
	Code int32 `json:"code"`

	Message string `json:"message"`
}

Error - Generic error object.

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{}
}

ImplResponse 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"`

	Name string `json:"name"`

	UserId string `json:"userId,omitempty"`

	DesignId string `json:"designId"`

	SchemaRevision int32 `json:"schemaRevision,omitempty"`

	CodeRevision int32 `json:"codeRevision,omitempty"`

	Priority JobPriority `json:"priority,omitempty"`

	Backend CommBackend `json:"backend"`

	MaxRunTime int32 `json:"maxRunTime,omitempty"`

	// Dataset specification
	DataSpec []RoleDatasetGroups `json:"dataSpec,omitempty"`

	ModelSpec ModelSpec `json:"modelSpec,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"`

	Name string `json:"name,omitempty"`

	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

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) GetJobsByCompute added in v0.2.3

func (c *JobsApiController) GetJobsByCompute(w http.ResponseWriter, r *http.Request)

GetJobsByCompute - Get status info on all the jobs by compute

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 the api routes 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)
	GetTasksInfoGeneric(context.Context, string, string, int32) (ImplResponse, error)
	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

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 be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type ModelSpec added in v0.2.2

type ModelSpec struct {
	BaseModel BaseModel `json:"baseModel,omitempty"`

	Optimizer Optimizer `json:"optimizer,omitempty"`

	Selector Selector `json:"selector,omitempty"`

	Hyperparameters map[string]interface{} `json:"hyperparameters,omitempty"`

	Dependencies []string `json:"dependencies,omitempty"`
}

ModelSpec - Model specification

type Optimizer added in v0.1.2

type Optimizer struct {
	Sort string `json:"sort,omitempty"`

	Kwargs map[string]interface{} `json:"kwargs,omitempty"`
}

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"`

	GroupAssociation []map[string]string `json:"groupAssociation,omitempty"`
}

Role - Define the role of a compute unit

type RoleDatasetGroups added in v0.2.3

type RoleDatasetGroups struct {
	Role string `json:"role,omitempty"`

	DatasetGroups map[string][]string `json:"datasetGroups,omitempty"`
}

RoleDatasetGroups - Dataset specification

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, opts ...DatasetsApiOption) Router

NewDatasetsApiController creates a default api controller

func NewDesignCodeApiController added in v0.3.0

func NewDesignCodeApiController(s DesignCodeApiServicer, opts ...DesignCodeApiOption) Router

NewDesignCodeApiController creates a default api controller

func NewDesignSchemaApiController added in v0.3.0

func NewDesignSchemaApiController(s DesignSchemaApiServicer, opts ...DesignSchemaApiOption) Router

NewDesignSchemaApiController creates a default api controller

func NewDesignsApiController

func NewDesignsApiController(s DesignsApiServicer, opts ...DesignsApiOption) Router

NewDesignsApiController creates a default api controller

func NewJobsApiController

func NewJobsApiController(s JobsApiServicer, opts ...JobsApiOption) Router

NewJobsApiController creates a default api controller

type Routes

type Routes []Route

Routes are a collection of defined api endpoints

type Selector

type Selector struct {
	Sort string `json:"sort,omitempty"`

	Kwargs map[string]interface{} `json:"kwargs,omitempty"`
}

type TaskInfo

type TaskInfo struct {
	JobId string `json:"jobId"`

	TaskId string `json:"taskId"`

	Role string `json:"role"`

	GroupAssociation map[string]string `json:"groupAssociation"`

	Key string `json:"key,omitempty"`

	State JobState `json:"state"`

	ComputeId string `json:"computeId,omitempty"`

	Log string `json:"log,omitempty"`

	Timestamp time.Time `json:"timestamp,omitempty"`
}

TaskInfo - Task information

type TaskStatus

type TaskStatus struct {
	State JobState `json:"state,omitempty"`

	Log string `json:"log,omitempty"`

	Timestamp time.Time `json:"timestamp,omitempty"`
}

TaskStatus - Task status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL