pulse

package
v0.0.0-...-85ebc88 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2017 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDNS  = 1
	TypeMTR  = 2
	TypeCurl = 3
)

Variables

This section is empty.

Functions

func GeneratePrivKeyFile

func GeneratePrivKeyFile(fname string)

func GetTLSConfig

func GetTLSConfig(caFile, certificateFile, privateKeyFile string) *tls.Config

func PrintCertRequest

func PrintCertRequest(privfname, reqfname string) string

func Runminion

func Runminion(cnc, caFile, certificateFile, privateKeyFile, reqFile, ver string) error

Types

type CombinedRequest

type CombinedRequest struct {
	Type        int
	Args        interface{}
	RequestedAt time.Time
	AgentFilter []*big.Int
}

func (*CombinedRequest) Clone

func (original *CombinedRequest) Clone() *CombinedRequest

Clone a CombinedRequest.. sort of deepcopy

type CombinedResult

type CombinedResult struct {
	Type         int           //Test type. 1=dns, 2=mtr, 3=curl
	Result       interface{}   //DNSResult for dns, CurlResult for curl and MtrResult for mtr
	CompletedAt  time.Time     //Time the test was completed
	TimeTaken    time.Duration //Time taken to run the test
	TimeTakenStr string        //Time taken to run the test in humanized form
	Err          string        //Any error, typically at RPC level
	Version      string        //The version of the minion that ran this test
	Name         string        //The name assigned to this agent.
	Agent        string        // /24 IP of the agent.
	ASN          *string       //ASN of the agent.
	ASName       *string       //ASN description of the agent.
	Country      string        //Agent's country
	State        string        //Agent's state
	City         string        //Agent's city
	Id           *big.Int      //Agent's ID - this is unique per agent
}

type CurlRequest

type CurlRequest struct {
	Path        string
	Endpoint    string
	Host        string
	Ssl         bool
	AgentFilter []*big.Int
}

type CurlResult

type CurlResult struct {
	Status          int                  //HTTP status of result
	Header          http.Header          //Headers
	Remote          string               //Remote IP the connection was made to
	Err             string               //Any Errors that happened. Usually for DNS fail or connection errors.
	ErrEnglish      string               //Human friendly version of Err
	Proto           string               //Response protocol
	StatusStr       string               //Status in stringified form
	DialTime        time.Duration        //Time it took for DNS + TCP connect.
	DNSTime         time.Duration        //Time it took for DNS.
	ConnectTime     time.Duration        //Time it took for  TCP connect.
	TLSTime         time.Duration        //Time it took for TLS handshake when running in SSL mode
	Ttfb            time.Duration        //Time it took since sending GET and getting results : total time minus DialTime minus TLSTime
	DialTimeStr     string               //Stringified
	DNSTimeStr      string               //Stringified
	ConnectTimeStr  string               //Stringified
	TLSTimeStr      string               //Stringified
	TtfbStr         string               //Stringified
	ConnectionState *tls.ConnectionState //Additional TLS data when running test over https. We snip out PublicKey from the certs cause they dont serialize well.
}

func CurlImpl

func CurlImpl(r *CurlRequest) *CurlResult

type DNSRequest

type DNSRequest struct {
	Host        string   //The DNS query
	QType       uint16   //Query type : https://en.wikipedia.org/wiki/List_of_DNS_record_types#Resource_records
	Targets     []string //The target nameservers
	NoRecursion bool     //true means RecursionDesired = false. false means RecursionDesired = true
	AgentFilter []*big.Int
}

type DNSResult

type DNSResult struct {
	Results []IndividualDNSResult
	Err     string //Error with this test
}

func DNSImpl

func DNSImpl(r *DNSRequest) *DNSResult

type IndividualDNSResult

type IndividualDNSResult struct {
	Server     string        //IP/hostname the query was sent to
	Err        string        //Any error that occurred with this particular query.
	ErrEnglish string        //Human friendly version of Err
	RttStr     string        //Round trip time in humanized form
	Rtt        time.Duration //Round trip time
	Raw        []byte        //Raw packet
	Formated   string        //Dig style formating
	Msg        *dns.Msg      //Parsed DNS message
	ASN        *string       //ASN of Server
	ASName     *string       //ASN description
}

type MtrRequest

type MtrRequest struct {
	Target      string
	IPv         string //blank for auto, 4 for IPv4, 6 for IPv6
	AgentFilter []*big.Int
}

type MtrResult

type MtrResult struct {
	Result     *mtrparser.MTROutPut
	Err        string
	ErrEnglish string //Human friendly version of Err
}

func MtrImpl

func MtrImpl(r *MtrRequest) *MtrResult

type Pinger

type Pinger struct {
	Last time.Time
}

func (*Pinger) Ping

func (p *Pinger) Ping(host, out *bool) error

The goal here is cnc will ping the minion regularly... if ping is not received then minion should revreate the connection...

type Resolver

type Resolver struct {
	Version string
}

func (*Resolver) Combined

func (r *Resolver) Combined(req *CombinedRequest, out *CombinedResult) error

Jump to

Keyboard shortcuts

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