Documentation ¶
Index ¶
- func Results() <-chan []*probe.Result
- func ScheduleProbe(label string, configuration map[string]interface{}, ...)
- type Client
- type ClientConfiguration
- type DumpedConfiguration
- func (*DumpedConfiguration) Descriptor() ([]byte, []int)
- func (m *DumpedConfiguration) GetConfigurations() *api.ListProbeConfigurationsResponse
- func (m *DumpedConfiguration) GetVersion() string
- func (*DumpedConfiguration) ProtoMessage()
- func (m *DumpedConfiguration) Reset()
- func (m *DumpedConfiguration) String() string
- func (m *DumpedConfiguration) XXX_DiscardUnknown()
- func (m *DumpedConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DumpedConfiguration) XXX_Merge(src proto.Message)
- func (m *DumpedConfiguration) XXX_Size() int
- func (m *DumpedConfiguration) XXX_Unmarshal(b []byte) error
- type DumpedSpooler
- func (*DumpedSpooler) Descriptor() ([]byte, []int)
- func (m *DumpedSpooler) GetResults() []*api.Result
- func (*DumpedSpooler) ProtoMessage()
- func (m *DumpedSpooler) Reset()
- func (m *DumpedSpooler) String() string
- func (m *DumpedSpooler) XXX_DiscardUnknown()
- func (m *DumpedSpooler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DumpedSpooler) XXX_Merge(src proto.Message)
- func (m *DumpedSpooler) XXX_Size() int
- func (m *DumpedSpooler) XXX_Unmarshal(b []byte) error
- type Scheduler
- func (s *Scheduler) AddProbe(label string, configuration map[string]interface{}, ...)
- func (s *Scheduler) ConfigureScheduler(c *api.ListProbeConfigurationsResponse, v string) error
- func (s *Scheduler) GetProbes() []string
- func (s Scheduler) GetVersion() string
- func (s *Scheduler) RemoveAllProbes() error
- func (s *Scheduler) Results() <-chan []*probe.Result
- func (s *Scheduler) Run()
- func (s *Scheduler) SetVersion(version string) error
- func (s Scheduler) String() string
- type Spooler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { api.PantoClient Organization string Agent string // contains filtered or unexported fields }
Client is the main structure for a Panto agent to connect to a Panto server and perform requests. It embeds a gRPC client for the Panto service, as defined in the proto files.
func NewClient ¶
func NewClient(conf ClientConfiguration) (*Client, error)
NewClient creates a gRPC client according to configuration and connects it to the server.
func (*Client) ReportResults ¶
ReportResults sends the result of a probe to the server it returns the configuration version and a (possible) error.
func (*Client) RequestConfiguration ¶
func (c *Client) RequestConfiguration() (res *api.ListProbeConfigurationsResponse, agentVersion string, err error)
RequestConfiguration sends a request for the agent's configuration to the server
type ClientConfiguration ¶
type ClientConfiguration struct { Address string AgentName string CertFilePath string NoTLS bool Timeout time.Duration ConfigurationDump string }
ClientConfiguration contains all configuration parameters to instantiate and connect a `Client`.
func (*ClientConfiguration) GetRequestMetadata ¶
func (c *ClientConfiguration) GetRequestMetadata(context.Context, ...string) (map[string]string, error)
GetRequestMetadata creates the gRPC request metadata from the client configuration.
func (*ClientConfiguration) RequireTransportSecurity ¶
func (c *ClientConfiguration) RequireTransportSecurity() bool
RequireTransportSecurity indicates whether the credentials requires transport security
type DumpedConfiguration ¶
type DumpedConfiguration struct { Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` Configurations *api.ListProbeConfigurationsResponse `protobuf:"bytes,2,opt,name=Configurations,proto3" json:"Configurations,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
DumpedConfiguration defines the representation of the backup file for the agent configuration
func (*DumpedConfiguration) Descriptor ¶
func (*DumpedConfiguration) Descriptor() ([]byte, []int)
func (*DumpedConfiguration) GetConfigurations ¶
func (m *DumpedConfiguration) GetConfigurations() *api.ListProbeConfigurationsResponse
func (*DumpedConfiguration) GetVersion ¶
func (m *DumpedConfiguration) GetVersion() string
func (*DumpedConfiguration) ProtoMessage ¶
func (*DumpedConfiguration) ProtoMessage()
func (*DumpedConfiguration) Reset ¶
func (m *DumpedConfiguration) Reset()
func (*DumpedConfiguration) String ¶
func (m *DumpedConfiguration) String() string
func (*DumpedConfiguration) XXX_DiscardUnknown ¶
func (m *DumpedConfiguration) XXX_DiscardUnknown()
func (*DumpedConfiguration) XXX_Marshal ¶
func (m *DumpedConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DumpedConfiguration) XXX_Merge ¶
func (dst *DumpedConfiguration) XXX_Merge(src proto.Message)
func (*DumpedConfiguration) XXX_Size ¶
func (m *DumpedConfiguration) XXX_Size() int
func (*DumpedConfiguration) XXX_Unmarshal ¶
func (m *DumpedConfiguration) XXX_Unmarshal(b []byte) error
type DumpedSpooler ¶ added in v0.5.0
type DumpedSpooler struct { Results []*api.Result `protobuf:"bytes,1,rep,name=Results,proto3" json:"Results,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
DumpedSpooler defines the representation of the backup file for the agent spooler
func (*DumpedSpooler) Descriptor ¶ added in v0.5.0
func (*DumpedSpooler) Descriptor() ([]byte, []int)
func (*DumpedSpooler) GetResults ¶ added in v0.5.0
func (m *DumpedSpooler) GetResults() []*api.Result
func (*DumpedSpooler) ProtoMessage ¶ added in v0.5.0
func (*DumpedSpooler) ProtoMessage()
func (*DumpedSpooler) Reset ¶ added in v0.5.0
func (m *DumpedSpooler) Reset()
func (*DumpedSpooler) String ¶ added in v0.5.0
func (m *DumpedSpooler) String() string
func (*DumpedSpooler) XXX_DiscardUnknown ¶ added in v0.5.0
func (m *DumpedSpooler) XXX_DiscardUnknown()
func (*DumpedSpooler) XXX_Marshal ¶ added in v0.5.0
func (m *DumpedSpooler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DumpedSpooler) XXX_Merge ¶ added in v0.5.0
func (dst *DumpedSpooler) XXX_Merge(src proto.Message)
func (*DumpedSpooler) XXX_Size ¶ added in v0.5.0
func (m *DumpedSpooler) XXX_Size() int
func (*DumpedSpooler) XXX_Unmarshal ¶ added in v0.5.0
func (m *DumpedSpooler) XXX_Unmarshal(b []byte) error
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is a probe scheduling engine. It contains a list of currently scheduled probes and handles executing probes at regular intervals.
var DefaultScheduler *Scheduler
DefaultScheduler is a default scheduler, instantiated by the package for usage by the easy interface (package-level functions).
func NewScheduler ¶
func NewScheduler() *Scheduler
NewScheduler creates and returns a new `Scheduler` instance.
func (*Scheduler) AddProbe ¶
func (s *Scheduler) AddProbe(label string, configuration map[string]interface{}, probeConfiguration, check string, interval time.Duration)
AddProbe schedules a probe to be fired every `interval`. It returns a function to be called to terminate the probe
func (*Scheduler) ConfigureScheduler ¶
func (s *Scheduler) ConfigureScheduler(c *api.ListProbeConfigurationsResponse, v string) error
ConfigureScheduler loads the api.ListProbeConfigurationsResponse in the Scheduler
func (*Scheduler) GetProbes ¶
GetProbes returns a copy of the Scheduler's ProbeConfiguration names. To avoid a race condition, the results are copied in the same goroutine as the add & remove critical operations and returned to the current context via a channel. Both copying and async introduce a latency & memory overhead. Use this method with that in mind.
func (Scheduler) GetVersion ¶
GetVersion returns the version of the configuration in the Scheduler
func (*Scheduler) RemoveAllProbes ¶
RemoveAllProbes flushes the current Scheduler from all the runningProbes
func (*Scheduler) Run ¶
func (s *Scheduler) Run()
Run starts the scheduler. This function does not return, it is safe to run in a goroutine.
func (*Scheduler) SetVersion ¶
SetVersion stores the version of the configuration in the Scheduler
type Spooler ¶
type Spooler struct {
// contains filtered or unexported fields
}
Spooler is used to spool data from a failed report, to try again when connectivity is re-established
func NewSpooler ¶
NewSpooler creates and returns a Spooler that can store up to maxResults. maxResults is the maximum number of results spooled. Once the maximum is reached, the spooler evicts the oldest results.
func (*Spooler) AddResults ¶
AddResults adds a batch of results to the Spooler. If the Spooler reaches max capacity, the oldest results are evicted.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package probe contains everything to register, schedule and run probes, as well as the default set of probes bundled into Panto <TODO> Conceptual documentation about the scheduler <TODO> Conceptual documentation about the registry
|
Package probe contains everything to register, schedule and run probes, as well as the default set of probes bundled into Panto <TODO> Conceptual documentation about the scheduler <TODO> Conceptual documentation about the registry |