types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package types contains types that are used by werifyd and its worker pools. It doesn't try to be an elegant solution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	Endpoint               wrpc.Endpoint
	Added                  time.Time
	LastHealthCheckAttempt *time.Time
	IsAlive                bool

	sync.Mutex
	Conn *rpc.Client
}

Host is the main struct for each host, satisfies the PoolData interface

func (*Host) GetHost

func (h *Host) GetHost() *Host

GetHost satisfies the PoolData interface, returning host

func (*Host) GetName

func (h *Host) GetName() string

GetName satisfies the PoolData interface, returning zero-value

func (*Host) GetOperation

func (h *Host) GetOperation() *wrpc.Operation

GetOperation satisfies the PoolData interface, returning zero-value

func (*Host) String

func (h *Host) String() string

String is the stringer method for the Host

type PoolData

type PoolData interface {
	GetName() string
	GetOperation() *wrpc.Operation
	GetHost() *Host
}

PoolData is used by the worker pool, which can be either an operation pool or an host pool

type WorkerOperation

type WorkerOperation struct {
	Name string
	wrpc.Operation
}

WorkerOperation is Operation with unique name attached, for the worker pool. Satisfies the PoolData interface.

func (*WorkerOperation) GetHost

func (w *WorkerOperation) GetHost() *Host

GetHost satisfies the PoolData interface, returning the zero-value

func (*WorkerOperation) GetName

func (w *WorkerOperation) GetName() string

GetName satisfies the PoolData interface, returning the name

func (*WorkerOperation) GetOperation

func (w *WorkerOperation) GetOperation() *wrpc.Operation

GetOperation satisfies the PoolData interface, returning the operation

Jump to

Keyboard shortcuts

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