model

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: May 10, 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
	JobStatusCancelled
)
View Source
const (
	ModuleStateConnected = string(iota + 1)
	ModuleStateDisconnected
	ModuleStateFaulted
	ModuleStateRunning
	ModuleStatePaused
	ModuleStateStopped
	ModuleStateReady
)

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",
		JobStatusCancelled: "CANCELLED",
	}
)
View Source
var (
	ModuleState = map[string]string{
		ModuleStateConnected:    "CONNECTED",
		ModuleStateDisconnected: "DISCONNECTED",
		ModuleStateFaulted:      "FAULTED",
		ModuleStateRunning:      "RUNNING",
		ModuleStatePaused:       "PAUSED",
		ModuleStateStopped:      "STOPPED",
		ModuleStateReady:        "READY",
	}
)

Functions

This section is empty.

Types

type Configuration

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

func (*Configuration) FromProtobuf

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

type Event added in v0.1.7

type Event struct {
	ID          int32
	Name        string
	Description string
}

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 {
	ModuleName    string
	ServiceName   string
	State         string
	Properties    []*Property
	Configuration *Configuration
	Status        *Status
	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 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 Status added in v0.1.7

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

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