api

package
v0.0.0-...-a01d039 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTPAddr contains the port used by this node
	HTTPAddr string
)

Functions

func AddJob

func AddJob(ctx *fasthttp.RequestCtx)

AddJob is used to create a new job

func AddJobStats

func AddJobStats(ctx *fasthttp.RequestCtx)

AddJobStats is used to parse collected metrics

func DeleteJob

func DeleteJob(ctx *fasthttp.RequestCtx)

DeleteJob is used to delete a job

func ExecuteYaml

func ExecuteYaml(ctx *fasthttp.RequestCtx)

ExecuteYaml is used to execute a job passed to the command line tool

func Executor

func Executor(ctx *fasthttp.RequestCtx)

Executor is used to execute the item at the head of the job queue

func GetJobDescription

func GetJobDescription(ctx *fasthttp.RequestCtx)

GetJobDescription is used to show a job's description

func GetJobLogs

func GetJobLogs(ctx *fasthttp.RequestCtx)

GetJobLogs is used to retrieve the logs for a job

func GetJobSchedule

func GetJobSchedule(ctx *fasthttp.RequestCtx)

GetJobSchedule is used to parse the request and return a cron time format

func GetJobStats

func GetJobStats(ctx *fasthttp.RequestCtx)

GetJobStats is used to show stats collected by a specified job

func InsertIntoMongo

func InsertIntoMongo(client *mongo.Client, typeOfValue string, desc string, value string, id string, timestamp string) bool

InsertIntoMongo is used to add collected metrics to the observability collection parameters: client (a *mongo.Client), typeOfValue (a string of the type of value being stored), desc (a string describing the value being stored), value (a string of the value being stored), id (a string of the associated Job ID), timestamp (a string of the unix time at which the operation took place) returns: bool (true is successful, false if otherwise)

func LinkJobs

func LinkJobs(ctx *fasthttp.RequestCtx)

LinkJobs is used to link two jobs together

func ListJobs

func ListJobs(ctx *fasthttp.RequestCtx)

ListJobs is used to list the current jobs running

func SetOdinEnv

func SetOdinEnv(mongoURL string)

SetOdinEnv is used to set variables to be used by running jobs via Odin SDK parameters: mongoURL (a string of the address for the MongoDB instance) returns: nil

func UnlinkJobs

func UnlinkJobs(ctx *fasthttp.RequestCtx)

UnlinkJobs is used to delete a job link

func UpdateJob

func UpdateJob(ctx *fasthttp.RequestCtx)

UpdateJob is used to update a job

func UpdateJobRuns

func UpdateJobRuns(ctx *fasthttp.RequestCtx)

UpdateJobRuns is used to update a job's run number

Types

type ExecNode

type ExecNode struct {
	Items []byte
	Store fsm.Store
}

ExecNode is a type to be used to unmarshal data into after a HTTP request consists of Items, a byte array of marshaled json, and a store of node details

type JobStats

type JobStats struct {
	ID          string
	Description string
	Type        string
	Value       string
	Timestamp   string
}

JobStats is a type to be used for accessing and storing job stats information

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a type to be used by the raft consensus protocol consists of a base http address and a store in the finite state machine

func NewService

func NewService(addr string, store fsm.Store) *Service

NewService is used to initialize a new service struct parameters: addr (a string of a http address), store (a store of node details) returns: *Service (a newly initialized service struct)

func (*Service) JoinCluster

func (service *Service) JoinCluster(ctx *fasthttp.RequestCtx)

JoinCluster is used to join a node to an exisiting cluster

func (*Service) LeaveCluster

func (service *Service) LeaveCluster(ctx *fasthttp.RequestCtx)

LeaveCluster is used to remove a node from a cluster

func (*Service) Start

func (service *Service) Start()

Start is called on a Service and is used to kick off its execution parameters: nil returns: nil

Jump to

Keyboard shortcuts

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