core

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 7 Imported by: 17

Documentation

Index

Constants

View Source
const (
	IN  int = 0
	OUT     = 1
	ERR     = 2
	ENV     = 3
)
View Source
const (
	PENDING  int = 0
	APPROVED     = 1
	REJECTED     = 2
)
View Source
const (
	WAITING int = 0
	RUNNING     = 1
	SUCCESS     = 2
	FAILED      = 3
)
View Source
const NOTSET = -1

Variables

This section is empty.

Functions

func ConvertColonyArrayToJSON

func ConvertColonyArrayToJSON(colonies []*Colony) (string, error)

func ConvertCronArrayToJSON

func ConvertCronArrayToJSON(crons []*Cron) (string, error)

func ConvertExecutorArrayToJSON added in v1.0.1

func ConvertExecutorArrayToJSON(executors []*Executor) (string, error)

func ConvertFileArrayToJSON added in v1.5.0

func ConvertFileArrayToJSON(files []*File) (string, error)

func ConvertFileDataArrayToJSON added in v1.7.4

func ConvertFileDataArrayToJSON(fileDataArr []*FileData) (string, error)

func ConvertFunctionArrayToJSON added in v1.0.1

func ConvertFunctionArrayToJSON(functions []*Function) (string, error)

func ConvertGeneratorArrayToJSON

func ConvertGeneratorArrayToJSON(generators []*Generator) (string, error)

func ConvertLabelArrayToJSON added in v1.5.0

func ConvertLabelArrayToJSON(labels []*Label) (string, error)

func ConvertLogArrayToJSON added in v1.4.0

func ConvertLogArrayToJSON(logs []*Log) (string, error)

func ConvertProcessArrayToJSON

func ConvertProcessArrayToJSON(processes []*Process) (string, error)

func ConvertProcessGraphArrayToJSON

func ConvertProcessGraphArrayToJSON(processGraphs []*ProcessGraph) (string, error)

func ConvertSnapshotArrayToJSON added in v1.5.0

func ConvertSnapshotArrayToJSON(snapshots []*Snapshot) (string, error)

func ConvertUserArrayToJSON added in v1.7.0

func ConvertUserArrayToJSON(users []*User) (string, error)

func GenerateRandomID

func GenerateRandomID() string

func IsAttributeArraysEqual

func IsAttributeArraysEqual(attributes1 []Attribute, attributes2 []Attribute) bool

func IsColonyArraysEqual

func IsColonyArraysEqual(colonies1 []*Colony, colonies2 []*Colony) bool

func IsCronArraysEqual

func IsCronArraysEqual(crons1 []*Cron, crons2 []*Cron) bool

func IsExecutorArraysEqual added in v1.0.1

func IsExecutorArraysEqual(executors1 []*Executor, executors2 []*Executor) bool

func IsFileArraysEqual added in v1.5.0

func IsFileArraysEqual(files1 []*File, files2 []*File) bool

func IsFileDataArraysEqual added in v1.7.4

func IsFileDataArraysEqual(fileDataArr1 []*FileData, fileDataArr2 []*FileData) bool

func IsFunctionArraysEqual added in v1.0.1

func IsFunctionArraysEqual(functions1 []*Function, functions2 []*Function) bool

func IsGeneratorArraysEqual

func IsGeneratorArraysEqual(generators1 []*Generator, generators2 []*Generator) bool

func IsLabelArraysEqual added in v1.5.0

func IsLabelArraysEqual(labels1 []*Label, labels2 []*Label) bool

func IsLogArraysEqual added in v1.4.0

func IsLogArraysEqual(logs1 []*Log, logs2 []*Log) bool

func IsProcessArraysEqual

func IsProcessArraysEqual(processes1 []*Process, processes2 []*Process) bool

func IsProcessGraphArraysEqual

func IsProcessGraphArraysEqual(processGraphs1 []*ProcessGraph, processGraphs2 []*ProcessGraph) bool

func IsProjectEqual added in v1.7.8

func IsProjectEqual(project1 Project, project2 Project) bool

func IsProjectsEqual added in v1.7.8

func IsProjectsEqual(projects1 map[string]Project, projects2 map[string]Project) bool

func IsSnapshotArraysEqual added in v1.5.0

func IsSnapshotArraysEqual(snapshots1 []*Snapshot, snapshots2 []*Snapshot) bool

func IsUserArraysEqual added in v1.7.0

func IsUserArraysEqual(users1 []*User, users2 []*User) bool

Types

type Allocations added in v1.7.3

type Allocations struct {
	Projects map[string]Project `json:"projects"`
}

type Attribute

type Attribute struct {
	ID                   string `json:"attributeid"`
	TargetID             string `json:"targetid"`
	TargetColonyName     string `json:"targetcolonyname"`
	TargetProcessGraphID string `json:"targetprocessgraphid"`
	State                int    `json:"state"`
	AttributeType        int    `json:"attributetype"`
	Key                  string `json:"key"`
	Value                string `json:"value"`
}

func ConvertJSONToAttribute

func ConvertJSONToAttribute(jsonString string) (Attribute, error)

func CreateAttribute

func CreateAttribute(targetID string,
	targetColonyName string,
	targetProcessGraphID string,
	attributeType int,
	key string,
	value string) Attribute

func (*Attribute) Equals

func (attribute *Attribute) Equals(attribute2 Attribute) bool

func (*Attribute) GenerateID

func (attribute *Attribute) GenerateID()

func (*Attribute) SetValue

func (attribute *Attribute) SetValue(value string)

func (*Attribute) ToJSON

func (attribute *Attribute) ToJSON() (string, error)

type Capabilities added in v1.4.0

type Capabilities struct {
	Hardware Hardware `json:"hardware"`
	Software Software `json:"software"`
}

type ColoniesError added in v1.1.2

type ColoniesError struct {
	Status  int
	Message string
}

func (*ColoniesError) Error added in v1.1.2

func (e *ColoniesError) Error() string

type Colony

type Colony struct {
	ID   string `json:"colonyid"`
	Name string `json:"name"`
}

func ConvertJSONToColony

func ConvertJSONToColony(jsonString string) (*Colony, error)

func ConvertJSONToColonyArray

func ConvertJSONToColonyArray(jsonString string) ([]*Colony, error)

func CreateColony

func CreateColony(id string, name string) *Colony

func (*Colony) Equals

func (colony *Colony) Equals(colony2 *Colony) bool

func (*Colony) SetID

func (colony *Colony) SetID(id string)

func (*Colony) ToJSON

func (colony *Colony) ToJSON() (string, error)

type Conditions

type Conditions struct {
	ColonyName       string   `json:"colonyname"`
	ExecutorNames    []string `json:"executornames"`
	ExecutorType     string   `json:"executortype"`
	Dependencies     []string `json:"dependencies"`
	Nodes            int      `json:"nodes"`
	CPU              string   `json:"cpu"`
	Processes        int      `json:"processes"`
	ProcessesPerNode int      `json:"processes-per-node"`
	Memory           string   `json:"mem"`
	Storage          string   `json:"storage"`
	GPU              GPU      `json:"gpu"`
	WallTime         int64    `json:"walltime"`
}

type ConflictResolution added in v1.6.1

type ConflictResolution struct {
	OnStart OnStart `json:"onstart"`
	OnClose OnClose `json:"onclose"`
}

type Cron

type Cron struct {
	ID                      string    `json:"cronid"`
	InitiatorID             string    `json:"initiatorid"`
	InitiatorName           string    `json:"initiatorname"`
	ColonyName              string    `json:"colonyname"`
	Name                    string    `json:"name"`
	CronExpression          string    `json:"cronexpression"`
	Interval                int       `json:"interval"`
	Random                  bool      `json:"random"`
	NextRun                 time.Time `json:"nextrun"`
	LastRun                 time.Time `json:"lastrun"`
	WorkflowSpec            string    `json:"workflowspec"`
	PrevProcessGraphID      string    `json:"prevprocessgraphid"`
	WaitForPrevProcessGraph bool      `json:"waitforprevprocessgraph"`
	CheckerPeriod           int       `json:"checkerperiod"`
}

func ConvertJSONToCron

func ConvertJSONToCron(jsonString string) (*Cron, error)

func ConvertJSONToCronArray

func ConvertJSONToCronArray(jsonString string) ([]*Cron, error)

func CreateCron

func CreateCron(colonyName string, name string, cronExpression string, interval int, random bool, workflowSpec string) *Cron

func (*Cron) Equals

func (cron *Cron) Equals(cron2 *Cron) bool

func (*Cron) HasExpired

func (cron *Cron) HasExpired() bool

func (*Cron) ToJSON

func (cron *Cron) ToJSON() (string, error)

type Data

type Data struct {
	Label string `json:"label"`
}

type Edge

type Edge struct {
	ID       string `json:"id"`
	Source   string `json:"source"`
	Target   string `json:"target"`
	Animated bool   `json:"animated"`
}

type Executor added in v1.0.1

type Executor struct {
	ID                string       `json:"executorid"`
	Type              string       `json:"executortype"`
	Name              string       `json:"executorname"`
	ColonyName        string       `json:"colonyname"`
	State             int          `json:"state"`
	RequireFuncReg    bool         `json:"requirefuncreg"`
	CommissionTime    time.Time    `json:"commissiontime"`
	LastHeardFromTime time.Time    `json:"lastheardfromtime"`
	Location          Location     `json:"location"`
	Capabilities      Capabilities `json:"capabilities"`
	Allocations       Allocations  `json:"allocations"`
}

func ConvertJSONToExecutor added in v1.0.1

func ConvertJSONToExecutor(jsonString string) (*Executor, error)

func ConvertJSONToExecutorArray added in v1.0.1

func ConvertJSONToExecutorArray(jsonString string) ([]*Executor, error)

func CreateExecutor added in v1.0.1

func CreateExecutor(id string,
	executorType string,
	name string,
	colonyName string,
	commissionTime time.Time,
	lastHeardFromTime time.Time) *Executor

func CreateExecutorFromDB added in v1.0.1

func CreateExecutorFromDB(id string,
	executorType string,
	name string,
	colonyName string,
	state int,
	requireFuncReg bool,
	commissionTime time.Time,
	lastHeardFromTime time.Time) *Executor

func (*Executor) Approve added in v1.0.1

func (executor *Executor) Approve()

func (*Executor) Equals added in v1.0.1

func (executor *Executor) Equals(executor2 *Executor) bool

func (*Executor) IsApproved added in v1.0.1

func (executor *Executor) IsApproved() bool

func (*Executor) IsPending added in v1.0.1

func (executor *Executor) IsPending() bool

func (*Executor) IsRejected added in v1.0.1

func (executor *Executor) IsRejected() bool

func (*Executor) Reject added in v1.0.1

func (executor *Executor) Reject()

func (*Executor) SetColonyName added in v1.7.0

func (executor *Executor) SetColonyName(colonyName string)

func (*Executor) SetID added in v1.0.1

func (executor *Executor) SetID(id string)

func (*Executor) ToJSON added in v1.0.1

func (executor *Executor) ToJSON() (string, error)

type Failure

type Failure struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func ConvertJSONToFailure

func ConvertJSONToFailure(jsonString string) (*Failure, error)

func CreateFailure

func CreateFailure(status int, message string) *Failure

func (*Failure) Equals

func (failure *Failure) Equals(failure2 *Failure) bool

func (*Failure) ToJSON

func (failure *Failure) ToJSON() (string, error)

type File added in v1.5.0

type File struct {
	ID             string    `json:"fileid"`
	ColonyName     string    `json:"colonyname"`
	Label          string    `json:"label"`
	Name           string    `json:"name"`
	Size           int64     `json:"size"`
	SequenceNumber int64     `json:"sequencenr"`
	Checksum       string    `json:"checksum"`
	ChecksumAlg    string    `json:"checksumalg"`
	Reference      Reference `json:"ref"`
	Added          time.Time `json:"added"`
}

func ConvertJSONToFile added in v1.5.0

func ConvertJSONToFile(jsonString string) (*File, error)

func ConvertJSONToFileArray added in v1.5.0

func ConvertJSONToFileArray(jsonString string) ([]*File, error)

func (*File) Equals added in v1.5.0

func (file *File) Equals(file2 *File) bool

func (*File) ToJSON added in v1.5.0

func (file *File) ToJSON() (string, error)

type FileData added in v1.7.4

type FileData struct {
	Name       string `json:"name"`
	Checksum   string `json:"checksum"`
	Size       int64  `json:"size"`
	S3Filename string `json:"s3filename"`
}

func ConvertJSONToFileData added in v1.7.4

func ConvertJSONToFileData(jsonString string) (*FileData, error)

func ConvertJSONToFileDataArray added in v1.7.4

func ConvertJSONToFileDataArray(jsonString string) ([]*FileData, error)

func (*FileData) Equals added in v1.7.4

func (fileData *FileData) Equals(fileData2 *FileData) bool

func (*FileData) ToJSON added in v1.7.4

func (fileData *FileData) ToJSON() (string, error)

type Filesystem added in v1.6.0

type Filesystem struct {
	Mount          string          `json:"mount"`
	SnapshotMounts []SnapshotMount `json:"snapshots"`
	SyncDirMounts  []SyncDirMount  `json:"dirs"`
}

type Function added in v1.0.1

type Function struct {
	FunctionID   string  `json:"functionid"`
	ExecutorName string  `json:"executorname"`
	ExecutorType string  `json:"executortype"`
	ColonyName   string  `json:"colonyname"`
	FuncName     string  `json:"funcname"`
	Counter      int     `json:"counter"`
	MinWaitTime  float64 `json:"minwaittime"`
	MaxWaitTime  float64 `json:"maxwaittime"`
	MinExecTime  float64 `json:"minexectime"`
	MaxExecTime  float64 `json:"maxexectime"`
	AvgWaitTime  float64 `json:"avgwaittime"`
	AvgExecTime  float64 `json:"avgexectime"`
}

func ConvertJSONToFunction added in v1.0.1

func ConvertJSONToFunction(jsonString string) (*Function, error)

func ConvertJSONToFunctionArray added in v1.0.1

func ConvertJSONToFunctionArray(jsonString string) ([]*Function, error)

func CreateFunction added in v1.0.1

func CreateFunction(functionID string,
	executorName string,
	executorType string,
	colonyName string,
	funcName string,
	counter int,
	minWaitTime float64,
	maxWaitTime float64,
	minExecTime float64,
	maxExecTime float64,
	avgWaitTime float64,
	avgExecTime float64) *Function

func (*Function) Equals added in v1.0.1

func (function *Function) Equals(function2 *Function) bool

func (*Function) ToJSON added in v1.0.1

func (function *Function) ToJSON() (string, error)

type FunctionSpec added in v1.0.1

type FunctionSpec struct {
	NodeName    string                 `json:"nodename"`
	FuncName    string                 `json:"funcname"`
	Args        []interface{}          `json:"args"`
	KwArgs      map[string]interface{} `json:"kwargs"`
	Priority    int                    `json:"priority"`
	MaxWaitTime int                    `json:"maxwaittime"`
	MaxExecTime int                    `json:"maxexectime"`
	MaxRetries  int                    `json:"maxretries"`
	Conditions  Conditions             `json:"conditions"`
	Label       string                 `json:"label"`
	Filesystem  Filesystem             `json:"fs"`
	Env         map[string]string      `json:"env"`
}

func ConvertJSONToFunctionSpec added in v1.0.1

func ConvertJSONToFunctionSpec(jsonString string) (*FunctionSpec, error)

func CreateEmptyFunctionSpec added in v1.0.1

func CreateEmptyFunctionSpec() *FunctionSpec

func CreateFunctionSpec added in v1.0.1

func CreateFunctionSpec(nodeName string, funcName string, args []interface{}, kwargs map[string]interface{}, colonyName string, executorNames []string, executorType string, maxWaitTime int, maxExecTime int, maxRetries int, env map[string]string, dependencies []string, priority int, label string) *FunctionSpec

func (*FunctionSpec) AddDependency added in v1.0.1

func (funcSpec *FunctionSpec) AddDependency(dependency string)

func (*FunctionSpec) Equals added in v1.0.1

func (funcSpec *FunctionSpec) Equals(funcSpec2 *FunctionSpec) bool

func (*FunctionSpec) ToJSON added in v1.0.1

func (funcSpec *FunctionSpec) ToJSON() (string, error)

type GPU added in v1.4.0

type GPU struct {
	Name      string `json:"name"`
	Memory    string `json:"mem"`
	Count     int    `json:"count"`
	NodeCount int    `json:"nodecount"`
}

type Generator

type Generator struct {
	ID            string    `json:"generatorid"`
	InitiatorID   string    `json:"initiatorid"`
	InitiatorName string    `json:"initiatorname"`
	ColonyName    string    `json:"colonyname"`
	Name          string    `json:"name"`
	WorkflowSpec  string    `json:"workflowspec"`
	Trigger       int       `json:"trigger"`
	Timeout       int       `json:"timeout"`
	FirstPack     time.Time `json:"firstpack"`
	LastRun       time.Time `json:"lastrun"`
	QueueSize     int       `json:"queuesize"`
	CheckerPeriod int       `json:"checkerperiod"`
}

func ConvertJSONToGenerator

func ConvertJSONToGenerator(jsonString string) (*Generator, error)

func ConvertJSONToGeneratorArray

func ConvertJSONToGeneratorArray(jsonString string) ([]*Generator, error)

func CreateGenerator

func CreateGenerator(colonyName string, name string, workflowSpec string, trigger int, timeout int) *Generator

func (*Generator) Equals

func (generator *Generator) Equals(generator2 *Generator) bool

func (*Generator) ToJSON

func (generator *Generator) ToJSON() (string, error)

type GeneratorArg

type GeneratorArg struct {
	ID          string
	GeneratorID string
	ColonyName  string
	Arg         string
}

func CreateGeneratorArg

func CreateGeneratorArg(generatorID string, colonyName string, arg string) *GeneratorArg

type Hardware added in v1.4.0

type Hardware struct {
	Model   string `json:"model"`
	Nodes   int    `json:"nodes"`
	CPU     string `json:"cpu"`
	Memory  string `json:"mem"`
	Storage string `json:"storage"`
	GPU     GPU    `json:"gpu"`
}

type Label added in v1.5.0

type Label struct {
	Name  string `json:"name"`
	Files int    `json:"files"`
}

func ConvertJSONToLabel added in v1.5.0

func ConvertJSONToLabel(jsonString string) (*Label, error)

func ConvertJSONToLabelArray added in v1.5.0

func ConvertJSONToLabelArray(jsonString string) ([]*Label, error)

func (*Label) Equals added in v1.5.0

func (label *Label) Equals(label2 *Label) bool

func (*Label) ToJSON added in v1.5.0

func (label *Label) ToJSON() (string, error)

type Location

type Location struct {
	Long        float64 `json:"long"`
	Lat         float64 `json:"lat"`
	Description string  `json:"desc"`
}

type Log added in v1.4.0

type Log struct {
	ProcessID    string `json:"processid"`
	ColonyName   string `json:"colonyname"`
	ExecutorName string `json:"executorname"`
	Message      string `json:"message"`
	Timestamp    int64  `json:"timestamp"` // UTC Unix time
}

func ConvertJSONToLog added in v1.4.0

func ConvertJSONToLog(jsonString string) (*Log, error)

func ConvertJSONToLogArray added in v1.4.0

func ConvertJSONToLogArray(jsonString string) ([]*Log, error)

func (*Log) Equals added in v1.4.0

func (log *Log) Equals(log2 *Log) bool

func (*Log) ToJSON added in v1.4.0

func (log *Log) ToJSON() (string, error)

type Node

type Node struct {
	ID       string   `json:"id"`
	Data     Data     `json:"data"`
	Position Position `json:"position"`
	Type     string   `json:"type"`
	Style    Style    `json:"style"`
}

type OnClose added in v1.6.2

type OnClose struct {
	KeepLocal bool `json:"keeplocal"`
}

type OnStart added in v1.6.2

type OnStart struct {
	KeepLocal bool `json:"keeplocal"`
}

type Position

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type Process

type Process struct {
	ID                 string        `json:"processid"`
	InitiatorID        string        `json:"initiatorid"`
	InitiatorName      string        `json:"initiatorname"`
	AssignedExecutorID string        `json:"assignedexecutorid"`
	IsAssigned         bool          `json:"isassigned"`
	State              int           `json:"state"`
	PriorityTime       int64         `json:"prioritytime"`
	SubmissionTime     time.Time     `json:"submissiontime"`
	StartTime          time.Time     `json:"starttime"`
	EndTime            time.Time     `json:"endtime"`
	WaitDeadline       time.Time     `json:"waitdeadline"`
	ExecDeadline       time.Time     `json:"execdeadline"`
	Retries            int           `json:"retries"`
	Attributes         []Attribute   `json:"attributes"`
	FunctionSpec       FunctionSpec  `json:"spec"`
	WaitForParents     bool          `json:"waitforparents"`
	Parents            []string      `json:"parents"`
	Children           []string      `json:"children"`
	ProcessGraphID     string        `json:"processgraphid"`
	Input              []interface{} `json:"in"`
	Output             []interface{} `json:"out"`
	Errors             []string      `json:"errors"`
}

func ConvertJSONToProcess

func ConvertJSONToProcess(jsonString string) (*Process, error)

func ConvertJSONToProcessArray

func ConvertJSONToProcessArray(jsonString string) ([]*Process, error)

func CreateProcess

func CreateProcess(funcSpec *FunctionSpec) *Process

func CreateProcessFromDB

func CreateProcessFromDB(funcSpec *FunctionSpec,
	id string,
	assignedExecutorID string,
	isAssigned bool,
	state int,
	priorityTime int64,
	submissionTime time.Time,
	startTime time.Time,
	endTime time.Time,
	waitDeadline time.Time,
	execDeadline time.Time,
	errors []string,
	retries int,
	attributes []Attribute) *Process

func (*Process) AddChild

func (process *Process) AddChild(childID string)

func (*Process) AddParent

func (process *Process) AddParent(parentID string)

func (*Process) Assign

func (process *Process) Assign()

func (*Process) Clone

func (process *Process) Clone() *Process

func (*Process) Equals

func (process *Process) Equals(process2 *Process) bool

func (*Process) ProcessingTime

func (process *Process) ProcessingTime() time.Duration

func (*Process) SetAssignedExecutorID added in v1.0.1

func (process *Process) SetAssignedExecutorID(executorID string)

func (*Process) SetAttributes

func (process *Process) SetAttributes(attributes []Attribute)

func (*Process) SetEndTime

func (process *Process) SetEndTime(endTime time.Time)

func (*Process) SetProcessGraphID

func (process *Process) SetProcessGraphID(processGraphID string)

func (*Process) SetStartTime

func (process *Process) SetStartTime(startTime time.Time)

func (*Process) SetState

func (process *Process) SetState(state int)

func (*Process) SetSubmissionTime

func (process *Process) SetSubmissionTime(submissionTime time.Time)

-50000 - 50000

func (*Process) ToJSON

func (process *Process) ToJSON() (string, error)

func (*Process) Unassign

func (process *Process) Unassign()

func (*Process) WaitingTime

func (process *Process) WaitingTime() time.Duration

type ProcessGraph

type ProcessGraph struct {
	ID             string    `json:"processgraphid"`
	InitiatorID    string    `json:"initiatorid"`
	InitiatorName  string    `json:"initiatorname"`
	ColonyName     string    `json:"colonyname"`
	Roots          []string  `json:"rootprocessids"`
	State          int       `json:"state"`
	SubmissionTime time.Time `json:"submissiontime"`
	StartTime      time.Time `json:"starttime"`
	EndTime        time.Time `json:"endtime"`
	ProcessIDs     []string  `json:"processids"`
	Nodes          []Node    `json:"nodes"`
	Edges          []Edge    `json:"edges"`
	// contains filtered or unexported fields
}

func ConvertJSONToProcessGraph

func ConvertJSONToProcessGraph(jsonString string) (*ProcessGraph, error)

func ConvertJSONToProcessGraphArray

func ConvertJSONToProcessGraphArray(jsonString string) ([]*ProcessGraph, error)

func ConvertJSONToProcessGraphWithStorage

func ConvertJSONToProcessGraphWithStorage(jsonString string) (*ProcessGraph, error)

func CreateProcessGraph

func CreateProcessGraph(colonyName string) (*ProcessGraph, error)

func (*ProcessGraph) AddRoot

func (graph *ProcessGraph) AddRoot(processID string)

func (*ProcessGraph) Depth

func (graph *ProcessGraph) Depth(childProcessID string) (int, error)

func (*ProcessGraph) Equals

func (graph *ProcessGraph) Equals(graph2 *ProcessGraph) bool

func (*ProcessGraph) FailedProcesses

func (graph *ProcessGraph) FailedProcesses() (int, error)

func (*ProcessGraph) GetRoot

func (graph *ProcessGraph) GetRoot(childProcessID string) (*Process, error)

func (*ProcessGraph) Iterate

func (graph *ProcessGraph) Iterate(visitFunc func(process *Process) error) error

func (*ProcessGraph) Leaves

func (graph *ProcessGraph) Leaves() ([]string, error)

func (*ProcessGraph) Processes

func (graph *ProcessGraph) Processes() (int, error)

func (*ProcessGraph) Resolve

func (graph *ProcessGraph) Resolve() error

func (*ProcessGraph) RunningProcesses

func (graph *ProcessGraph) RunningProcesses() (int, error)

func (*ProcessGraph) SetStorage

func (graph *ProcessGraph) SetStorage(storage ProcessGraphStorage)

func (*ProcessGraph) SuccessfulProcesses

func (graph *ProcessGraph) SuccessfulProcesses() (int, error)

func (*ProcessGraph) ToJSON

func (graph *ProcessGraph) ToJSON() (string, error)

func (*ProcessGraph) UpdateProcessIDs

func (graph *ProcessGraph) UpdateProcessIDs() error

func (*ProcessGraph) WaitForParents

func (graph *ProcessGraph) WaitForParents() (int, error)

func (*ProcessGraph) WaitProcesses

func (graph *ProcessGraph) WaitProcesses() (int, error)

type ProcessGraphStorage

type ProcessGraphStorage interface {
	GetProcessByID(processID string) (*Process, error)
	SetProcessState(processID string, state int) error
	SetWaitForParents(processID string, waitForParent bool) error
	SetProcessGraphState(processGraphID string, state int) error
}

type Project added in v1.7.3

type Project struct {
	AllocatedCPU     int64 `json:"allocatedcpu"`
	UsedCPU          int64 `json:"usedcpu"`
	AllocatedGPU     int64 `json:"allocatedgpu"`
	UsedGPU          int64 `json:"usedgpu"`
	AllocatedStorage int64 `json:"allocatedstorage"`
	UsedStorage      int64 `json:"usedstorage"`
}

type Reference added in v1.5.0

type Reference struct {
	Protocol string   `json:"protocol"`
	S3Object S3Object `json:"s3object"`
}

type S3Object added in v1.5.0

type S3Object struct {
	Server        string `json:"server"`
	Port          int    `json:"port"`
	TLS           bool   `json:"tls"`
	AccessKey     string `json:"accesskey"`
	SecretKey     string `json:"secretkey"`
	Region        string `json:"region"`
	EncryptionKey string `json:"encryptionkey"`
	EncryptionAlg string `json:"encryptionalg"`
	Object        string `json:"object"`
	Bucket        string `json:"bucket"`
}

type Snapshot added in v1.5.0

type Snapshot struct {
	ID         string    `json:"snapshotid"`
	ColonyName string    `json:"colonyname"`
	Label      string    `json:"label"`
	Name       string    `json:"name"`
	FileIDs    []string  `json:"fileids"`
	Added      time.Time `json:"added"`
}

func ConvertJSONToSnapshot added in v1.5.0

func ConvertJSONToSnapshot(jsonString string) (*Snapshot, error)

func ConvertJSONToSnapshotsArray added in v1.5.0

func ConvertJSONToSnapshotsArray(jsonString string) ([]*Snapshot, error)

func (*Snapshot) Equals added in v1.5.0

func (snapshot *Snapshot) Equals(snapshot2 *Snapshot) bool

func (*Snapshot) ToJSON added in v1.5.0

func (snapshot *Snapshot) ToJSON() (string, error)

type SnapshotMount added in v1.6.0

type SnapshotMount struct {
	SnapshotID  string `json:"snapshotid"`
	Label       string `json:"label"`
	Dir         string `json:"dir"`
	KeepFiles   bool   `json:"keepfiles"`
	KeepSnaphot bool   `json:"keepsnapshot"`
}

type Software added in v1.4.0

type Software struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Version string `json:"version"`
}

type Statistics

type Statistics struct {
	Colonies            int `json:"colonies"`
	Executors           int `json:"executors"`
	WaitingProcesses    int `json:"waitingprocesses"`
	RunningProcesses    int `json:"runningprocesses"`
	SuccessfulProcesses int `json:"successfulprocesses"`
	FailedProcesses     int `json:"failedprocesses"`
	WaitingWorkflows    int `json:"waitingworkflows"`
	RunningWorkflows    int `json:"runningworkflows"`
	SuccessfulWorkflows int `json:"successfulworkflows"`
	FailedWorkflows     int `json:"failedworkflows"`
}

func ConvertJSONToStatistics

func ConvertJSONToStatistics(jsonString string) (*Statistics, error)

func CreateStatistics

func CreateStatistics(colonies int,
	executors int,
	waitingProcesses int,
	runningProcesses int,
	successfulProcesses int,
	failedProcesses int,
	waitingWorkflows int,
	runningWorkflows int,
	successfulWorkflows int,
	failedWorkflows int) *Statistics

func (*Statistics) Equals

func (stat *Statistics) Equals(stat2 *Statistics) bool

func (*Statistics) ToJSON

func (stat *Statistics) ToJSON() (string, error)

type Style

type Style struct {
	Color      string `json:"color"`
	Background string `json:"background"`
}

type SyncDirMount added in v1.6.0

type SyncDirMount struct {
	Label              string             `json:"label"`
	Dir                string             `json:"dir"`
	KeepFiles          bool               `json:"keepfiles"`
	ConflictResolution ConflictResolution `json:"onconflicts"`
}

type User added in v1.7.0

type User struct {
	ColonyName string `json:"colonyname"`
	ID         string `json:"userid"`
	Name       string `json:"name"`
	Email      string `json:"email"`
	Phone      string `json:"phone"`
}

func ConvertJSONToUser added in v1.7.0

func ConvertJSONToUser(jsonString string) (*User, error)

func ConvertJSONToUserArray added in v1.7.0

func ConvertJSONToUserArray(jsonString string) ([]*User, error)

func CreateUser added in v1.7.0

func CreateUser(colonyName string, userID string, name string, email string, phone string) *User

func (*User) Equals added in v1.7.0

func (user *User) Equals(user2 *User) bool

func (*User) ToJSON added in v1.7.0

func (user *User) ToJSON() (string, error)

type WorkflowSpec

type WorkflowSpec struct {
	ColonyName    string         `json:"colonyname"`
	FunctionSpecs []FunctionSpec `json:"functionspecs"`
}

func ConvertJSONToWorkflowSpec

func ConvertJSONToWorkflowSpec(jsonString string) (*WorkflowSpec, error)

func CreateWorkflowSpec

func CreateWorkflowSpec(colonyName string) *WorkflowSpec

func (*WorkflowSpec) AddFunctionSpec added in v1.0.1

func (workflowSpec *WorkflowSpec) AddFunctionSpec(funcSpec *FunctionSpec)

func (*WorkflowSpec) Equals

func (workflowSpec *WorkflowSpec) Equals(workflowSpec2 *WorkflowSpec) bool

func (*WorkflowSpec) ToJSON

func (workflowSpec *WorkflowSpec) ToJSON() (string, error)

Jump to

Keyboard shortcuts

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