mcapi

package module
v0.0.0-...-ed7bad2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 17 Imported by: 0

README

gomcapi

Go version of MCAPI

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuth = errors.New("authentication")

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey  string
	BaseURL string
}

func NewClient

func NewClient(baseURL string) *Client

func (*Client) AddMeasurementsToSampleInProcess

func (c *Client) AddMeasurementsToSampleInProcess(projectID, experimentID, processID string, simple bool, sm SampleMeasurements) (*Sample, error)

func (*Client) AddSampleAndFilesToProcess

func (c *Client) AddSampleAndFilesToProcess(projectID, experimentID string, simple bool, connect ConnectSampleAndFilesToProcess) (*Sample, error)

func (*Client) AddSampleToProcess

func (c *Client) AddSampleToProcess(projectID, experimentID string, simple bool, connect ConnectSampleToProcess) (*Sample, error)

func (*Client) AddSamplesToProcess

func (c *Client) AddSamplesToProcess(projectID, experimentID string, connect ConnectSamplesToProcess) ([]Sample, error)

func (*Client) CreateExperiment

func (c *Client) CreateExperiment(projectID, name, description string, inProgress bool) (*Experiment, error)

func (*Client) CreateProcess

func (c *Client) CreateProcess(projectID, experimentID, name, processType string, setups []Setup) (*Process, error)

func (*Client) CreateProject

func (c *Client) CreateProject(name, description string) (*Project, error)

func (*Client) CreateSample

func (c *Client) CreateSample(projectID, experimentID, name string, attributes []Property) (*Sample, error)

func (*Client) DeleteProject

func (c *Client) DeleteProject(projectID string) error

func (*Client) GetFileByPathInProject

func (c *Client) GetFileByPathInProject(filePath, projectID string) (*File, error)

func (*Client) GetProjectOverviewByName

func (c *Client) GetProjectOverviewByName(name string) (*Project, error)

func (*Client) Login

func (c *Client) Login(userID, password string) error

func (*Client) UpdateExperimentProgressStatus

func (c *Client) UpdateExperimentProgressStatus(projectID, experimentID string, inProgress bool) error

type ConnectSampleAndFilesToProcess

type ConnectSampleAndFilesToProcess struct {
	ProcessID     string
	SampleID      string
	PropertySetID string
	Transform     bool
	FilesByName   []FileAndDirection
	FilesByID     []FileAndDirection
}

type ConnectSampleToProcess

type ConnectSampleToProcess struct {
	ProcessID     string
	SampleID      string
	PropertySetID string
	Transform     bool
}

type ConnectSamplesToProcess

type ConnectSamplesToProcess struct {
	ProcessID string
	Transform bool
	Samples   []SampleToConnect
}

type Dataset

type Dataset struct {
}

type Experiment

type Experiment struct {
	ID            string     `json:"id"`
	Name          string     `json:"name"`
	Owner         string     `json:"owner"`
	Description   string     `json:"description"`
	Birthtime     Timestamp  `json:"-"` // `json:"birthtime"`
	MTime         Timestamp  `json:"-"` // `json:"mtime"`
	Citations     []string   `json:"citations"`
	Collaborators []string   `json:"collaborators"`
	Funding       []string   `json:"funding"`
	Goals         []string   `json:"goals"`
	Publications  []string   `json:"publications"`
	Papers        []string   `json:"papers"`
	Status        string     `json:"status"`
	Processes     []*Process `json:"processes"`
	Samples       []*Sample  `json:"samples"`
	Datasets      []*Dataset `json:"datasets"`
}

Experiment is where the user does their work collecting data, creating the workflow, etc...

type File

type File struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name"`
}

type FileAndDirection

type FileAndDirection struct {
	FileID    string `json:"file_id,omitempty"`
	Path      string `json:"path,omitempty"`
	Direction string `json:"direction"`
}

type Measurement

type Measurement struct {
	OType         string      `json:"otype"`
	Unit          string      `json:"unit"`
	Value         interface{} `json:"value"`
	IsBestMeasure bool        `json:"is_best_measure"`
}

type Process

type Process struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	Owner         string    `json:"owner"`
	Description   string    `json:"description"`
	DoesTransform bool      `json:"does_transform"`
	ProcessType   string    `json:"process_type"`
	Birthtime     Timestamp `json:"-"` // `json:"birthtime"`
	MTime         Timestamp `json:"-"` // `json:"mtime"`
	InputSamples  []*Sample `json:"input_samples"`
	OutputSamples []*Sample `json:"output_samples"`
	Files         []*File   `json:"files"`
	TemplateID    string    `json:"template_id"`
	TemplateName  string    `json:"template_name"`
}

type Project

type Project struct {
	ID          string         `json:"id"`
	Name        string         `json:"name"`
	Owner       string         `json:"owner"`
	Description string         `json:"description"`
	Birthtime   Timestamp      `json:"birthtime"`
	MTime       Timestamp      `json:"mtime"`
	FileCount   int            `json:"files"`
	Notes       []*ProjectNote `json:"notes"`
	Experiments []*Experiment  `json:"experiments"`
	Samples     []*Sample      `json:"samples"`
	Todos       []*ProjectTodo `json:"todos"`
	Users       []*ProjectUser `json:"users"`
}

A Project is a container for holding experiments and files and setting up access controls

type ProjectNote

type ProjectNote struct {
	ID        string    `json:"id"`
	Title     string    `json:"title"`
	Note      string    `json:"note"`
	Birthtime Timestamp `json:"-"` // `json:"birthtime"`
	MTime     Timestamp `json:"-"` // `json:"mtime"`
	Owner     string    `json:"owner"`
}

A ProjectNote is a note for a project

type ProjectTodo

type ProjectTodo struct {
	Title string `json:"title"`
}

ProjectTodo is a simple representation of a to-do. When a ProjectTodo is completed it is simply deleted from the server.

type ProjectUser

type ProjectUser struct {
	UserID    string    `json:"user_id"`
	Fullname  string    `json:"fullname"`
	Birthtime Timestamp `json:"-"` // `json:"birthtime"`
}

ProjectUser is a user that has access to the project

type Property

type Property struct {
	ID           string        `json:"id,omitempty"`
	Name         string        `json:"name"`
	Description  string        `json:"description"`
	Measurements []Measurement `json:"measurements"`
}

type Sample

type Sample struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	Owner         string    `json:"owner"`
	Description   string    `json:"description"`
	PropertySetID string    `json:"property_set_id"`
	Birthtime     Timestamp `json:"-"` // `json:"birthtime"`
	MTime         Timestamp `json:"-"` // `json:"mtime"`
}

type SampleMeasurements

type SampleMeasurements struct {
	SampleID      string
	PropertySetID string
	Attributes    []SampleProperty
}

type SampleProperty

type SampleProperty struct {
	Name         string                 `json:"name"`
	ID           string                 `json:"id,omitempty"`
	Measurements []Measurement          `json:"measurements"`
	Metadata     map[string]interface{} `json:"metadata"`
}

type SampleToConnect

type SampleToConnect struct {
	SampleID      string `json:"sample_id"`
	PropertySetID string `json:"property_set_id"`
	Name          string `json:"name"`
}

type Setup

type Setup struct {
	ID         string           `json:"id"`
	Name       string           `json:"name"`
	Attribute  string           `json:"attribute"`
	Properties []*SetupProperty `json:"properties"`
}

type SetupProperty

type SetupProperty struct {
	ID          string      `json:"id"`
	Attribute   string      `json:"attribute"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	OType       string      `json:"otype"`
	Unit        string      `json:"unit"`
	Value       interface{} `json:"value"`
}

type Timestamp

type Timestamp time.Time

func (*Timestamp) MarshalJSON

func (t *Timestamp) MarshalJSON() ([]byte, error)

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

Directories

Path Synopsis
mc
cmd
pkg

Jump to

Keyboard shortcuts

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