fullerite: github.com/Yelp/fullerite/src/fullerite/util Index | Files

package util

import "github.com/Yelp/fullerite/src/fullerite/util"

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

Package Files

doc.go file.go http_alive.go iptools.go marathon_chronos_leader.go nerve_config.go strutil.go uwsgi_stats_parser.go

func CreateMinimalNerveConfig Uses

func CreateMinimalNerveConfig(config map[string]EndPoint) map[string]map[string]map[string]interface{}

CreateMinimalNerveConfig creates a minimal nerve config

func ExternalIP Uses

func ExternalIP() (string, error)

ExternalIP Provides the string representation of the IP address of the box.

func GetFileSize Uses

func GetFileSize(filePath string) (int64, error)

GetFileSize returns the size in bytes of the specified file

func GetWrapper Uses

func GetWrapper(url string, client http.Client) ([]byte, error)

GetWrapper performs a get against a URL and return either the body of the response or an error

func IPInHostInterfaces Uses

func IPInHostInterfaces(ip string, log *l.Entry) (bool, error)

IPInHostInterfaces checks if given IP is assigned to a local interface

func IsLeader Uses

func IsLeader(host string, endpoint string, client http.Client, log *l.Entry) (bool, error)

IsLeader checks if a given host is the marathon leader

func ParseUWSGIWorkersStats Uses

func ParseUWSGIWorkersStats(raw []byte) ([]metric.Metric, error)

ParseUWSGIWorkersStats Counts workers status stats from JSON content and returns metrics

func StrSanitize Uses

func StrSanitize(s string, allowPunctuation bool, allowedPunctuation []rune) string

StrSanitize enables handler lever sanitation

func StrToFloat Uses

func StrToFloat(val string) float64

StrToFloat converts a string value to float

type EndPoint Uses

type EndPoint struct {
    Host string
    Port string
}

EndPoint defines a struct for endpoints

type HTTPAlive Uses

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

HTTPAlive implements a simple way of reusing http connections

func (*HTTPAlive) Configure Uses

func (connection *HTTPAlive) Configure(timeout time.Duration,
    aliveDuration time.Duration,
    maxIdleConnections int)

Configure the http connection

func (*HTTPAlive) MakeRequest Uses

func (connection *HTTPAlive) MakeRequest(method string,
    uri string, body io.Reader, header map[string]string) (*HTTPAliveResponse, error)

MakeRequest make a new http request

type HTTPAliveResponse Uses

type HTTPAliveResponse struct {
    StatusCode int
    Body       []byte
    Header     http.Header
}

HTTPAliveResponse returns a response

type NerveService Uses

type NerveService struct {
    Name      string
    Namespace string
    Port      int
}

NerveService is an exported struct containing services' info

func ParseNerveConfig Uses

func ParseNerveConfig(raw *[]byte, namespaceIncluded bool) ([]NerveService, error)

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

Package util imports 15 packages (graph). Updated 2019-09-16. Refresh now. Tools for package owners.

The go get command cannot install this package because of the following issues: