server

package
v0.0.0-...-60dd28f Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: MIT Imports: 16 Imported by: 0

README

Introduction

An execuable app which implements a subset of the gearman protocol

Not implemented features

Requests

  • GRAB_JOB_UNIQ
  • ALL_YOURS
  • SUBMIT_JOB_SCHED (no plan to add)
  • SUBMIT_JOB_EPOCH (no plan to add)

Administrative Protocol

Usage

git clone git@gitlab.com:peonone/gearman.git
cd gearman
go get -u github.com/golang/dep/...
dep ensure
go install ./server/gearmand/
$GOPATH/bin/gearmand

command line options

-bind-addr string
	Addr the server should listen on. (default ":4730")
-httptest.serve string
    if non-empty, httptest.NewServer serves on this address and blocks
-log-file string
    the log file (default "/usr/local/var/log/gearmand.log")
-log-stderr
    print logs to stderr (default true)
-queue-type string
    queue type (default "sql")
-request-timeout duration
    request timeout (default 1s)
-sql-queue-datasource string
    sql queue datasource (default "gearmand.dat")
-sql-queue-driver string
    sql queue driver (default "sqlite3")
-verbose
    enable verbose mode

Internals

queue

For now only SQLite3 queue is supported(will add more in future)

Documentation

Index

Constants

View Source
const QueueSQL = "sql"

QueueSQL is the name of the sql queue

View Source
const QueueSqlite3Driver = "sqlite3"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr        string
	LogFilePath     string
	LogToStderr     bool
	Verbose         bool
	QueueType       string
	QueueDriver     string
	QueueDataSource string
	QueueTableName  string
	RequestTimeout  time.Duration
}

type MockHandler

type MockHandler struct {
	mock.Mock
}

MockHandler is an implementation for unit test

type Server

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

Server represents a gearman server instance

func NewServer

func NewServer(cfg *Config) (*Server, error)

func (*Server) Run

func (s *Server) Run() error

Run runs the gearman server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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