model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExperimentStatusReady = string(iota + 1)
	ExperimentStatusRunning
	ExperimentStatusStarted
	ExperimentStatusStopped
	ExperimentStatusPaused
	ExperimentStatusWaiting
	ExperimentStatusFailed
)
View Source
const (
	JobStatusSubmitted = string(iota + 1)
	JobStatusRunning
	JobStatusStopped
	JobStatusPaused
	JobStatusFinished
	JobStatusFailed
)
View Source
const (
	ModuleStatusConnected = string(iota + 1)
	ModuleStatusDisconnected
	ModuleStatusFaulted
	ModuleStatusRunning
	ModuleStatusPaused
	ModuleStatusStopped
	ModuleStatusReady
)

Variables

View Source
var (
	ExperimentStatus = map[string]string{
		ExperimentStatusReady:   "READY",
		ExperimentStatusRunning: "RUNNING",
		ExperimentStatusStarted: "STARTED",
		ExperimentStatusStopped: "STOPPED",
		ExperimentStatusPaused:  "PAUSED",
		ExperimentStatusWaiting: "WAITING",
		ExperimentStatusFailed:  "FAILED",
	}
)
View Source
var (
	JobStatus = map[string]string{
		JobStatusSubmitted: "SUBMITTED",
		JobStatusRunning:   "RUNNING",
		JobStatusStopped:   "STOPPED",
		JobStatusPaused:    "PAUSED",
		JobStatusFinished:  "FINISHED",
		JobStatusFailed:    "FAILED",
	}
)
View Source
var (
	ModuleStatus = map[string]string{
		ModuleStatusConnected:    "CONNECTED",
		ModuleStatusDisconnected: "DISCONNECTED",
		ModuleStatusFaulted:      "FAULTED",
		ModuleStatusRunning:      "RUNNING",
		ModuleStatusPaused:       "PAUSED",
		ModuleStatusStopped:      "STOPPED",
		ModuleStatusReady:        "READY",
	}
)

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ID         string
	Namespace  string
	Objects    []*Object
	Properties []*Property
}

func (*Configuration) FromProtobuf

func (c *Configuration) FromProtobuf(in *pb.Configuration) error

type Experiment added in v0.1.2

type Experiment struct {
	ID                string
	Status            string
	Name              string
	StartTime         float64
	EstimatedDuration float64
	TimeElapsed       float64
	Modules           []*Module
	Properties        []*Property
}

Experiment links modules with runtimes and results

type Job added in v0.1.2

type Job struct {
	ID         string
	Status     string
	StartTime  float64
	FinishTime float64
	Module     *Module
	Properties []*Property
}

Job links modules with runtimes and results

type LoginResponse

type LoginResponse struct {
	*Response
	AccessToken string `json:"access_token,omitempty"`
}

type Module added in v0.1.2

type Module struct {
	ID         string
	Name       string
	Type       string
	Status     string
	Properties []*Property
	Jobs       []*Job
}

type Object

type Object struct {
	ID         string
	Name       string
	Type       string
	Objects    []*Object
	Properties []*Property
}

func (*Object) FromProtobuf

func (o *Object) FromProtobuf(in *pb.Object) error

type Permission

type Permission struct {
	ID   int64
	Name string
}

type Property

type Property struct {
	Key   string
	Value string
}

Property : Describes the details through KV structure

func (*Property) FromProtobuf

func (p *Property) FromProtobuf(in *pb.Property) error

FromProtobuf : Sets the Property's key and value from the Protobuf property

type ProtoModule added in v0.1.2

type ProtoModule struct {
	ID              string
	Name            string
	ServiceName     string
	ConfigurationID string
	Status          *ProtoStatus
	State           *ProtoState
	Types           []int32
}

ProtoModule : Model for Module responses from the broker.

type ProtoState added in v0.1.2

type ProtoState struct {
	ID          string
	Name        string
	Description string
}

ProtoState : Model for State responses from the broker.

type ProtoStatus added in v0.1.2

type ProtoStatus struct {
	Enabled bool
	Loaded  bool
	Active  bool
	Details map[string]string
}

ProtoStatus : Model for Status responses from the broker.

type Response

type Response struct {
	Code  int    `json:"code"`
	Error string `json:"error,omitempty"`
}

type Role

type Role struct {
	ID        string
	Name      string
	CreatedAt string `db:"created_at"`
}

type User

type User struct {
	ID        string
	Email     string
	Password  string
	IPAddress string `db:"ip_address"`
	CreatedAt string `db:"created_at"`
	Roles     []*Role
}

func (*User) ComparePassword

func (user *User) ComparePassword(password string) bool

func (*User) HashedPassword

func (user *User) HashedPassword() error

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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