controller

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeURL added in v0.4.1

func MakeURL(hostname string, port int) string

Types

type APIClient added in v0.4.0

type APIClient interface {
	DoPOST(target, body string) error
}

type Controller

type Controller struct {
	Broker    *broker.Broker
	APIClient APIClient
	NewLeader chan string
	NewClient chan string
	MyURL     string
	// contains filtered or unexported fields
}

Controller structure

func New added in v0.3.0

func New(hostname string, port int, interval time.Duration, alternate bool) *Controller

func (*Controller) IsRegistered added in v0.3.0

func (c *Controller) IsRegistered() bool

func (*Controller) Run

func (c *Controller) Run()

type RealAPIClient added in v0.4.0

type RealAPIClient struct {
	HTTPClient *http.Client
}

func (*RealAPIClient) DoPOST added in v0.4.0

func (client *RealAPIClient) DoPOST(targetURL, body string) (err error)

Jump to

Keyboard shortcuts

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