probes

package
v0.0.0-...-b28dce8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package probes is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/probes/config.proto

It has these top-level messages:

ProbeDef

Probes package provides an interface to initialize probes using prober config.

Index

Constants

View Source
const Default_ProbeDef_IntervalMsec int32 = 2000
View Source
const Default_ProbeDef_TimeoutMsec int32 = 1000

Variables

View Source
var ProbeDef_Type_name = map[int32]string{
	0: "PING",
	1: "HTTP",
	2: "DNS",
	3: "EXTERNAL",
	4: "UDP",
	5: "USER_DEFINED",
}
View Source
var ProbeDef_Type_value = map[string]int32{
	"PING":         0,
	"HTTP":         1,
	"DNS":          2,
	"EXTERNAL":     3,
	"UDP":          4,
	"USER_DEFINED": 5,
}

Functions

func Init

func Init(probeProtobufs []*ProbeDef, globalTargetsOpts *targets.GlobalTargetsOptions, sysVars map[string]string) map[string]Probe

Init initializes the probes defined in the config.

func Register

func Register(name string, probe Probe)

Register allows you to register a user defined probe with cloudprober. Example usage:

import (
	"github.com/google/cloudprober"
	"github.com/google/cloudprober/probes"
)

p := &FancyProbe{}
probes.Register("fancy_probe", p)
pr, err := cloudprober.InitFromConfig(*configFile)
if err != nil {
	log.Exitf("Error initializing cloudprober. Err: %v", err)
}

Types

type Probe

type Probe interface {
	Init(name string, tgts targets.Targets, interval, timeout time.Duration, l *logger.Logger, config interface{}) error
	Start(ctx context.Context, dataChan chan *metrics.EventMetrics)
}

Probe interface represents a probe.

A probe is initilized using the Init() method. Init takes the name of the probe, a targets.Targets object, interval (how often to run the probe), timeout, a logger.Logger handle and the probe type specific config.

Start() method starts the probe. Start is not expected to return for the lifetime of the prober. It takes a data channel that it writes the probe results on. Actual publishing of these results is handled by cloudprober itself.

type ProbeDef

type ProbeDef struct {
	Name *string        `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Type *ProbeDef_Type `protobuf:"varint,2,req,name=type,enum=cloudprober.probes.ProbeDef_Type" json:"type,omitempty"`
	// Which machines this probe should run on. If defined, cloudprober will run
	// this probe only if machine's hostname matches this value.
	RunOn *string `protobuf:"bytes,3,opt,name=run_on,json=runOn" json:"run_on,omitempty"`
	// Interval between two probes
	IntervalMsec *int32 `protobuf:"varint,4,opt,name=interval_msec,json=intervalMsec,def=2000" json:"interval_msec,omitempty"`
	// Timeout for each probe
	TimeoutMsec *int32 `protobuf:"varint,5,opt,name=timeout_msec,json=timeoutMsec,def=1000" json:"timeout_msec,omitempty"`
	// Targets for the probe
	Targets *cloudprober_targets.TargetsDef `protobuf:"bytes,6,req,name=targets" json:"targets,omitempty"`
	// Types that are valid to be assigned to Probe:
	//	*ProbeDef_PingProbe
	//	*ProbeDef_HttpProbe
	//	*ProbeDef_DnsProbe
	//	*ProbeDef_ExternalProbe
	//	*ProbeDef_UdpProbe
	//	*ProbeDef_UserDefinedProbe
	Probe            isProbeDef_Probe `protobuf_oneof:"probe"`
	XXX_unrecognized []byte           `json:"-"`
}

func (*ProbeDef) Descriptor

func (*ProbeDef) Descriptor() ([]byte, []int)

func (*ProbeDef) GetDnsProbe

func (m *ProbeDef) GetDnsProbe() *cloudprober_probes_dns.ProbeConf

func (*ProbeDef) GetExternalProbe

func (m *ProbeDef) GetExternalProbe() *cloudprober_probes_external.ProbeConf

func (*ProbeDef) GetHttpProbe

func (m *ProbeDef) GetHttpProbe() *cloudprober_probes_http.ProbeConf

func (*ProbeDef) GetIntervalMsec

func (m *ProbeDef) GetIntervalMsec() int32

func (*ProbeDef) GetName

func (m *ProbeDef) GetName() string

func (*ProbeDef) GetPingProbe

func (m *ProbeDef) GetPingProbe() *cloudprober_probes_ping.ProbeConf

func (*ProbeDef) GetProbe

func (m *ProbeDef) GetProbe() isProbeDef_Probe

func (*ProbeDef) GetRunOn

func (m *ProbeDef) GetRunOn() string

func (*ProbeDef) GetTargets

func (m *ProbeDef) GetTargets() *cloudprober_targets.TargetsDef

func (*ProbeDef) GetTimeoutMsec

func (m *ProbeDef) GetTimeoutMsec() int32

func (*ProbeDef) GetType

func (m *ProbeDef) GetType() ProbeDef_Type

func (*ProbeDef) GetUdpProbe

func (m *ProbeDef) GetUdpProbe() *cloudprober_probes_udp.ProbeConf

func (*ProbeDef) GetUserDefinedProbe

func (m *ProbeDef) GetUserDefinedProbe() string

func (*ProbeDef) ProtoMessage

func (*ProbeDef) ProtoMessage()

func (*ProbeDef) Reset

func (m *ProbeDef) Reset()

func (*ProbeDef) String

func (m *ProbeDef) String() string

func (*ProbeDef) XXX_OneofFuncs

func (*ProbeDef) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type ProbeDef_DnsProbe

type ProbeDef_DnsProbe struct {
	DnsProbe *cloudprober_probes_dns.ProbeConf `protobuf:"bytes,22,opt,name=dns_probe,json=dnsProbe,oneof"`
}

type ProbeDef_ExternalProbe

type ProbeDef_ExternalProbe struct {
	ExternalProbe *cloudprober_probes_external.ProbeConf `protobuf:"bytes,23,opt,name=external_probe,json=externalProbe,oneof"`
}

type ProbeDef_HttpProbe

type ProbeDef_HttpProbe struct {
	HttpProbe *cloudprober_probes_http.ProbeConf `protobuf:"bytes,21,opt,name=http_probe,json=httpProbe,oneof"`
}

type ProbeDef_PingProbe

type ProbeDef_PingProbe struct {
	PingProbe *cloudprober_probes_ping.ProbeConf `protobuf:"bytes,20,opt,name=ping_probe,json=pingProbe,oneof"`
}

type ProbeDef_Type

type ProbeDef_Type int32
const (
	ProbeDef_PING         ProbeDef_Type = 0
	ProbeDef_HTTP         ProbeDef_Type = 1
	ProbeDef_DNS          ProbeDef_Type = 2
	ProbeDef_EXTERNAL     ProbeDef_Type = 3
	ProbeDef_UDP          ProbeDef_Type = 4
	ProbeDef_USER_DEFINED ProbeDef_Type = 5
)

func (ProbeDef_Type) Enum

func (x ProbeDef_Type) Enum() *ProbeDef_Type

func (ProbeDef_Type) EnumDescriptor

func (ProbeDef_Type) EnumDescriptor() ([]byte, []int)

func (ProbeDef_Type) String

func (x ProbeDef_Type) String() string

func (*ProbeDef_Type) UnmarshalJSON

func (x *ProbeDef_Type) UnmarshalJSON(data []byte) error

type ProbeDef_UdpProbe

type ProbeDef_UdpProbe struct {
	UdpProbe *cloudprober_probes_udp.ProbeConf `protobuf:"bytes,24,opt,name=udp_probe,json=udpProbe,oneof"`
}

type ProbeDef_UserDefinedProbe

type ProbeDef_UserDefinedProbe struct {
	UserDefinedProbe string `protobuf:"bytes,99,opt,name=user_defined_probe,json=userDefinedProbe,oneof"`
}

Directories

Path Synopsis
dns
Package dns is a generated protocol buffer package.
Package dns is a generated protocol buffer package.
cmd
Dns_bin implements a stand-alone dns prober binary using the cloudprober/probes/dns package.
Dns_bin implements a stand-alone dns prober binary using the cloudprober/probes/dns package.
Package external is a generated protocol buffer package.
Package external is a generated protocol buffer package.
cmd
This program implements a stand-alone external prober binary using the cloudprober/probes/external package.
This program implements a stand-alone external prober binary using the cloudprober/probes/external package.
serverutils
Package serverutils is a generated protocol buffer package.
Package serverutils is a generated protocol buffer package.
Package http is a generated protocol buffer package.
Package http is a generated protocol buffer package.
cmd
This program implements a stand-alone http prober binary using the cloudprober/http package.
This program implements a stand-alone http prober binary using the cloudprober/http package.
Package ping is a generated protocol buffer package.
Package ping is a generated protocol buffer package.
cmd
This program implements a stand-alone ping prober binary using the cloudprober/ping package.
This program implements a stand-alone ping prober binary using the cloudprober/ping package.
udp
Package udp is a generated protocol buffer package.
Package udp is a generated protocol buffer package.
cmd
Udp_bin implements a stand-alone udp prober binary using the cloudprober/probes/udp package.
Udp_bin implements a stand-alone udp prober binary using the cloudprober/probes/udp package.

Jump to

Keyboard shortcuts

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