utils

package
v0.0.0-...-7558982 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(vs []string, f func(string) bool) []string

Filter elements in a string array with a certain function

func KMap

func KMap(vs []string, f func(string) string) map[string]string

KMap calls a function on all the items in a string array and returns the results as a map, containing the original string as key

func ListFiles

func ListFiles(dir string) []string

ListFiles lists all the files in a given directory

func Map

func Map(vs []string, f func(string) string) []string

Map calls a function on all the items in a string array

func NewKeepAliveManager

func NewKeepAliveManager(taskname string, zmqAddress string) *keepAliveManager

NewKeepAliveManager initialise a ZeroMQ socket and the keep-alive message to send

func ZmqPubSubProxy

func ZmqPubSubProxy(host string, portIn int, portOut int, logger *log.Logger)

ZmqPubSubProxy Implements a many-to-many device on a zmq PUB-SUB connection

func ZmqReadPartN

func ZmqReadPartN(s *zmq.Socket, n int, buf *[]byte)

ZmqReadPartN reads a multi-part message but only writes the requested part into the provided buffer

func ZmqRecvMulti

func ZmqRecvMulti(s *zmq.Socket) []string

ZmqRecvMulti Receives a multi-part message and return it as a slice of strings

func ZmqSendMulti

func ZmqSendMulti(s *zmq.Socket, msg []string)

ZmqSendMulti Sends a slice of strings as a multi-part message

Types

type JobqueueHTTPClient

type JobqueueHTTPClient struct {
	URL url.URL
}

JobqueueHTTPClient provides some utility methods to communicate with the Task Manager runner via HTTP

func (*JobqueueHTTPClient) List

func (client *JobqueueHTTPClient) List() (string, error)

List the task managers listening at this address

func (*JobqueueHTTPClient) ListAsList

func (client *JobqueueHTTPClient) ListAsList() []string

ListAsList returns a list of task names (as a string slice)

func (*JobqueueHTTPClient) ListWorkers

func (client *JobqueueHTTPClient) ListWorkers(name string) (string, error)

ListWorkers gets the status of each worker process for a given task

func (*JobqueueHTTPClient) Open

func (client *JobqueueHTTPClient) Open(url string) (string, error)

Open an HTTP connection to control the task manager runner

func (*JobqueueHTTPClient) Set

func (client *JobqueueHTTPClient) Set(name string, param string, value string) (string, error)

Set an option on a certain task

func (*JobqueueHTTPClient) Start

func (client *JobqueueHTTPClient) Start(name string) (string, error)

Start a stopped task

func (*JobqueueHTTPClient) Status

func (client *JobqueueHTTPClient) Status(name string) (string, error)

Status gets some information about the status of a task (or all of them)

func (*JobqueueHTTPClient) Stop

func (client *JobqueueHTTPClient) Stop(name string) (string, error)

Stop a running task, or all of them

Jump to

Keyboard shortcuts

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