swarm

package
v0.0.0-...-e5949e2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: BSD-2-Clause Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ADJECTIVES = []string{"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark", "summer",
		"icy", "delicate", "quiet", "white", "cool", "spring", "winter", "patient",
		"twilight", "dawn", "crimson", "wispy", "weathered", "blue", "billowing",
		"broken", "cold", "damp", "falling", "frosty", "green", "long", "late", "lingering",
		"bold", "little", "morning", "muddy", "old", "red", "rough", "still", "small",
		"sparkling", "throbbing", "shy", "wandering", "withered", "wild", "black",
		"young", "holy", "solitary", "fragrant", "aged", "snowy", "proud", "floral",
		"restless", "divine", "polished", "ancient", "purple", "lively", "nameless"}
	NOUNS = []string{"waterfall", "river", "breeze", "moon", "rain", "wind", "sea", "morning",
		"snow", "lake", "sunset", "pine", "shadow", "leaf", "dawn", "glitter", "forest",
		"hill", "cloud", "meadow", "sun", "glade", "bird", "brook", "butterfly",
		"bush", "dew", "dust", "field", "fire", "flower", "firefly", "feather", "grass",
		"haze", "mountain", "night", "pond", "darkness", "snowflake", "silence",
		"sound", "sky", "shape", "surf", "thunder", "violet", "water", "wildflower",
		"wave", "water", "resonance", "sun", "wood", "dream", "cherry", "tree", "fog",
		"frost", "voice", "paper", "frog", "smoke", "star"}
)

Functions

func CreateKeyValueEntry

func CreateKeyValueEntry(key string, value interface{})

CreateKeyValueEntry is a method

func IsLeader

func IsLeader() bool

IsLeader reveals if this host is the leader for the swarm.

func LeaderAddr

func LeaderAddr() string

LeaderAddr returns the IP address or DNS name of the current cluster leader.

func Pipeline

func Pipeline() <-chan interface{}

Pipeline does something

func SetupHTTP

func SetupHTTP(mux *mux.Router)

SetupHTTP takes an http.ServeMux and adds a few paths to it.

func Start

func Start(options ...Option) error

Start gets the swarm up and running

Types

type Namer

type Namer interface {
	Haikunate() string
}

func NewName

func NewName() Namer

type Option

type Option func(*Options)

Option custom type

func DataDir

func DataDir(path string) Option

DataDir sets the path to store data

func HTTP

func HTTP(port string) Option

HTTP defines a custom HTTP port

func Join

func Join(host string) Option

Join specifies the host and port that we should talk to in order to join the swarm

func Name

func Name(name string) Option

Name specifies the name with which to represent ourselves in the swarm

func Port

func Port(port string) Option

Port defines on which TCP/IP port the web server will run on

type Options

type Options struct {
	Port       string
	SingleNode bool
	Join       string
	Name       string
	Named      bool
	DataDir    string
	HTTP       string
}

Options contain the configuration for the swarm

type RandomName

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

func (RandomName) Haikunate

func (r RandomName) Haikunate() string

Jump to

Keyboard shortcuts

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