Documentation ¶
Index ¶
- Variables
- func AddJobLink(client *mongo.Client, from string, to string, uid string) int64
- func ChownR(path string, uid, gid int) bool
- func DeleteJobByValue(client *mongo.Client, filter bson.M, uid string) bool
- func DeleteJobLink(client *mongo.Client, from string, to string, uid string) int64
- func Format(id string, description string, valType string, value string) string
- func InsertIntoMongo(client *mongo.Client, d []byte, path string, uid string) string
- func MakePostRequest(link string, data *bytes.Buffer) string
- func RunLinks(links []string, uid uint32, httpAddr string, store fsm.Store)
- func SchFormat(id string, name, string, description string, links string, schedule string) string
- func SetupClient() (*mongo.Client, error)
- func SetupEnvironment(d []byte) string
- func StartTicker(store fsm.Store, httpAddr string)
- func UpdateJobByValue(client *mongo.Client, job NewJob) int64
- type ExecNode
- type JobStats
- type NewJob
- type Node
- type Queue
Constants ¶
This section is empty.
Variables ¶
var GID int
GID is used to store the group id associated with a specific group
var URI = resources.UnmarsharlYaml(resources.ReadFileBytes(getHome() + "/odin-config.yml")).Mongo.Address
URI is used to store the address to the MongoDB instance used by the Odin Engine
Functions ¶
func AddJobLink ¶
AddJobLink is used to add links the job is associated with parameters: client (a *mongo.Client), from (a string of a job ID to give a new link), to (a string of a job ID to create a link to), uid (a string of the user's ID) returns: int64 (value of the number of entries modified)
func ChownR ¶
ChownR is used to recursively change the owner of each subdir under /etc parameters: path (a string of the directory path to chown), uid (an int used to set the owner uid), gid (an int used to set the owner gid) returns: bool
func DeleteJobByValue ¶
DeleteJobByValue is used to delete a job in MongoDB parameters: parameters: client (a *mongo.Client), filter (a bson encoding of a job id), uid (a string of the user's ID) returns: bool (whether a job was deleted or not)
func DeleteJobLink ¶
DeleteJobLink is used to delete links the job is associated with parameters: client (a *mongo.Client), from (a string of a job ID to remove a link from), to (a string of a job ID to remove), uid (a string of the user's ID) returns: int64 (value of the number of entries modified)
func Format ¶
Format is used to format the output of MongoDB stat contents parameters: id, description, valType, value (four strings corresponding to individual job stats) returns: string (a space formatted string used for display)
func InsertIntoMongo ¶
InsertIntoMongo is used to add information to the MongoDB instance parameters: client (a *mongo.Client), d (a byte array containing marshaled JSON), and path (a string to set as the new job.File) returns: interface{} (an interface on the insertion results)
func MakePostRequest ¶
MakePostRequest is used to make a post request to a given url parameters: link (a string of the link to make a request to), data (a buffer to pass to the post request) returns: string (the result of a POST to the provided link with the given data)
func RunLinks ¶
RunLinks is used to run jobs linked to a job which has just been executed parameters: links (a string array of Job ID's to execute), uid (a uint32 of that user's id), httpAddr (a string port of the master node), store (a fsm.Store containing information about other nodes) returns: nil
func SchFormat ¶
SchFormat is used to parse and format the output of the MongoDB schedule contents parameters: id, name, description, schedule (four strings corresponding to individual job data) returns: string (a space formatted string used for display)
func SetupClient ¶
SetupClient is used to set up a MongoDB client and test it with a ping command parameters: nil returns: *mogno.Client (a client)
func SetupEnvironment ¶
SetupEnvironment is used to kickstart the process for setting up the correct directories and files used by odin parameters: d (a byte array containing marshaled JSON) returns: string (the path to the newly created file)
func StartTicker ¶
StartTicker starts the countdown process, specifying the parameters of execution for doEvery parameters: store (a fsm containing node information), httpAddr (an address string from the server) returns: nil
Types ¶
type ExecNode ¶
ExecNode is a type used to define the job data executed and the finite state machine info
type JobStats ¶
JobStats is a type to be used for accessing and storing job stats information
func GetJobStats ¶
GetJobStats is used to retrieve the stats associated with each job from the MongoDB instance parameters: client (a *mongo.Client), id (a string representation of a job's id) returns: []JobStats (the collection of fetched job stats)
type NewJob ¶
type NewJob struct { ID string `yaml:"id"` UID string `yaml:"uid"` GID string `yaml:"gid"` Name string `yaml:"name"` Description string `yaml:"description"` Language string `yaml:"language"` File string `yaml:"file"` Stats string `yaml:"stats"` Schedule string `yaml:"schedule"` Runs int Links string }
NewJob is a type to be used for accessing and storing job information
func GetAll ¶
GetAll is used to return all jobs in MongoDB parameters: client (a *mongo.Client) returns: []NewJob (all jobs in the Mongo instance)
func GetJobByValue ¶
GetJobByValue is used to return a job in MongoDB by filtering on a certain value pertaining to that job parameters: client (a *mongo.Client), filter (a bson encoding of a job id), uid (a string of the user's ID) returns: NewJob (the fetched job)