Documentation ¶
Index ¶
- Variables
- func DatasetSourceAddressRequired(source string) bool
- func DatasetSourceValid(source string) bool
- func ModuleSourceAddressRequired(source string) bool
- func ModuleSourceValid(source string) bool
- func ModuleTypeValid(moduleType string) bool
- type APIErrorResponse
- type APIKeyCredentials
- type BasicCredentials
- type Context
- func (context Context) CreateDataset(id, name, description, source, sourceAddress, accessKey string) (string, error)
- func (context Context) CreateJob(dataset, objective string, models []string, altObjectives []string, ...) (string, error)
- func (context Context) CreateModule(id, moduleType, label, name, description, source, sourceAddress string) (string, error)
- func (context Context) CreateUser(id, password, name string) (string, error)
- func (context Context) GetDatasetByID(id string) (result *types.Dataset, err error)
- func (context Context) GetDatasets(status, source, schemaIn, schemaOut string) (result []types.Dataset, err error)
- func (context Context) GetJobByID(id string) (result *types.Job, err error)
- func (context Context) GetJobs(user, status, job, objective, modelName string) (result []types.Job, err error)
- func (context Context) GetModuleByID(id string) (result *types.Module, err error)
- func (context Context) GetModules(moduleType, user, status, source, schemaIn, schemaOut string) (result []types.Module, err error)
- func (context Context) GetMyID() (result string, err error)
- func (context Context) GetProcesses(status string) (result []types.Process, err error)
- func (context Context) GetTaskByID(id string) (result *types.Task, err error)
- func (context Context) GetTasks(job, user, status, stage, dataset, objective, modelName string) (result []types.Task, err error)
- func (context Context) GetUserByID(id string) (result *types.User, err error)
- func (context Context) GetUsers(status string) (result []types.User, err error)
- func (context Context) Login(username, password string) (result string, err error)
- func (context Context) Logout() error
- func (context Context) UpdateDataset(id string, updates map[string]interface{}) (err error)
- func (context Context) UpdateModule(id string, updates map[string]interface{}) (err error)
- func (context Context) UploadDataset(id, sourcePath string) error
- func (context Context) UploadModule(id, sourcePath string) error
- type Credentials
Constants ¶
This section is empty.
Variables ¶
var ValidDatasetSources = []string{ types.DatasetUpload, types.DatasetDownload, types.DatasetLocal, types.DatasetGit, }
ValidDatasetSources is a list of possible dataset sources.
var ValidModuleSources = []string{ types.ModuleUpload, types.ModuleDownload, types.ModuleLocal, types.ModuleRegistry, }
ValidModuleSources is a list of possible module sources.
var ValidModuleTypes = []string{ types.ModuleModel, types.ModuleObjective, types.ModuleOptimizer, }
ValidModuleTypes is a list of possible module types.
Functions ¶
func DatasetSourceAddressRequired ¶
DatasetSourceAddressRequired returns true if the source address property is required for a given source.
func DatasetSourceValid ¶
DatasetSourceValid checks if the provided dataset source is valid.
func ModuleSourceAddressRequired ¶
ModuleSourceAddressRequired returns true if the source address property is required for a given source.
func ModuleSourceValid ¶
ModuleSourceValid checks if the provided module source is valid.
func ModuleTypeValid ¶
ModuleTypeValid checks if the provided module type is valid.
Types ¶
type APIErrorResponse ¶
type APIErrorResponse struct { Code int `json:"code"` Error string `json:"error"` RequestID string `json:"request-id"` }
APIErrorResponse is a JSON object that is returned by the ease.ml API when an error occurs.
func (*APIErrorResponse) String ¶
func (resp *APIErrorResponse) String() string
type APIKeyCredentials ¶
type APIKeyCredentials struct {
APIKey string
}
APIKeyCredentials contains an API key which can be applied to a request.
func (APIKeyCredentials) Apply ¶
func (cred APIKeyCredentials) Apply(header http.Header)
Apply applies the given credentials to an HTTP request.
type BasicCredentials ¶
BasicCredentials represents a username and password pair which can be applied to a request.
func (BasicCredentials) Apply ¶
func (cred BasicCredentials) Apply(header http.Header)
Apply applies the given credentials to an HTTP request.
type Context ¶
type Context struct { ServerAddress string UserCredentials Credentials }
Context contains all information needed to use the api functionality.
func (Context) CreateDataset ¶
func (context Context) CreateDataset(id, name, description, source, sourceAddress, accessKey string) (string, error)
CreateDataset creates a new dataset given the provided parameters.
func (Context) CreateJob ¶
func (context Context) CreateJob(dataset, objective string, models []string, altObjectives []string, acceptNewModels bool, maxTasks uint64) (string, error)
CreateJob creates a new job given the provided parameters.
func (Context) CreateModule ¶
func (context Context) CreateModule(id, moduleType, label, name, description, source, sourceAddress string) (string, error)
CreateModule creates a new module given the provided parameters.
func (Context) CreateUser ¶
CreateUser creates a new user given the provided parameters.
func (Context) GetDatasetByID ¶
GetDatasetByID returns a dataset given its ID.
func (Context) GetDatasets ¶
func (context Context) GetDatasets(status, source, schemaIn, schemaOut string) (result []types.Dataset, err error)
GetDatasets returns all datasets from the service.
func (Context) GetJobByID ¶
GetJobByID returns a job given its ID.
func (Context) GetJobs ¶
func (context Context) GetJobs(user, status, job, objective, modelName string) (result []types.Job, err error)
GetJobs returns all jobs from the service.
func (Context) GetModuleByID ¶
GetModuleByID returns a module given its ID.
func (Context) GetModules ¶
func (context Context) GetModules(moduleType, user, status, source, schemaIn, schemaOut string) (result []types.Module, err error)
GetModules returns all modules from the service.
func (Context) GetProcesses ¶
GetProcesses returns all processes from the service.
func (Context) GetTaskByID ¶
GetTaskByID returns a task given its ID.
func (Context) GetTasks ¶
func (context Context) GetTasks(job, user, status, stage, dataset, objective, modelName string) (result []types.Task, err error)
GetTasks returns all tasks from the service.
func (Context) GetUserByID ¶
GetUserByID returns a user given its ID.
func (Context) Login ¶
Login takes a username and password and attempts to log the user in. If the login was successful, the API key is returned which can be used to authenticate the user.
func (Context) UpdateDataset ¶
UpdateDataset applies the given updates to the dataset fields.
func (Context) UpdateModule ¶
UpdateModule applies the given updates to the module fields.
func (Context) UploadDataset ¶
UploadDataset uploads the dataset to the server.
func (Context) UploadModule ¶
UploadModule uploads the module to the server.
type Credentials ¶
Credentials represents a structure that is able to authenticate a user.