Documentation ¶
Overview ¶
Package util is catchall for all utilities that might be used throughout the fullerite code.
iptools.go: It includes functionality to determine the ip address of the machine that's running a fullerite instance.
mesos_leader.go: Detects the leader from amongst a set of mesos masters. It also caches this value for a configurable ttl to save time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExternalIP ¶
ExternalIP Provides the string representation of the IP address of the box.
func GetFileSize ¶
GetFileSize returns the size in bytes of the specified file
func ParseNerveConfig ¶
ParseNerveConfig is responsible for taking the JSON string coming in into a map of service:port it will also filter based on only services runnign on this host. To deal with multi-tenancy we actually will return port:service
Types ¶
type HTTPAlive ¶
type HTTPAlive struct {
// contains filtered or unexported fields
}
HTTPAlive implements a simple way of reusing http connections
func (*HTTPAlive) Configure ¶
func (connection *HTTPAlive) Configure(timeout time.Duration, aliveDuration time.Duration, maxIdleConnections int)
Configure the http connection
func (*HTTPAlive) MakeRequest ¶
func (connection *HTTPAlive) MakeRequest(method string, uri string, body io.Reader) (*HTTPAliveResponse, error)
MakeRequest make a new http request
type HTTPAliveResponse ¶
HTTPAliveResponse returns a response
type MesosLeaderElect ¶
type MesosLeaderElect struct {
// contains filtered or unexported fields
}
MesosLeaderElect Encapsulation for the mesos leader given a set of masters. Cache this so that we don't spend too much time determining the leader every *collector.Collect() call, which happens every 10 seconds.
func (*MesosLeaderElect) Configure ¶
func (mle *MesosLeaderElect) Configure(nodes string, ttl time.Duration)
Configure Provide the set of masters like so ("http://1.2.3.4:5050/,http://5.6.7.8:5050/") and the desired TTL for the cache.
func (*MesosLeaderElect) Get ¶
func (mle *MesosLeaderElect) Get() string
Get get the IP of the leader; calls *MesosLeaderElect.set() on the first call or if the TTL has expired.