servers

package
v0.13.7 Latest Latest
Warning

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

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

README

This directory is for helper servers available for use with Cloudprober. Cloudprober itself is a prober daemon with primary purpose to run probes but since it runs on all of our probing VMs, it provides a perfect platform to run servers that can act as the backend for probes that need to access something on cloud.

Documentation

Overview

Package servers provides an interface to initialize cloudprober servers using servers config.

Index

Constants

This section is empty.

Variables

View Source
var StatusTmpl = template.Must(template.New("statusTmpl").Parse(`
<table class="status-list">
  <tr>
    <th>Type</th>
    <th>Conf</th>
  </tr>
  {{ range . }}
  <tr>
    <td>{{.Type}}</td>
    <td>
    {{if .Conf}}
      <pre>{{.Conf}}</pre>
    {{else}}
      default
    {{end}}
    </td>
  </tr>
  {{ end }}
</table>
`))

StatusTmpl variable stores the HTML template suitable to generate the servers' status for cloudprober's /status page. It expects an array of ServerInfo objects as input.

Functions

This section is empty.

Types

type Server

type Server interface {
	Start(ctx context.Context, dataChan chan<- *metrics.EventMetrics) error
}

Server interface has only one method: Start.

type ServerInfo

type ServerInfo struct {
	Server
	Type      string
	ServerDef *configpb.ServerDef
	Conf      string
}

ServerInfo encapsulates a Server and related info.

func Init

func Init(initCtx context.Context, serverDefs []*configpb.ServerDef) (servers []*ServerInfo, err error)

Init initializes cloudprober servers, based on the provided config.

Directories

Path Synopsis
Package external adds support for an external server.
Package external adds support for an external server.
Package grpc provides a simple gRPC server that acts as a probe target.
Package grpc provides a simple gRPC server that acts as a probe target.
Package http implements an HTTP server that simply returns 'ok' for any URL and sends stats on a string channel.
Package http implements an HTTP server that simply returns 'ok' for any URL and sends stats on a string channel.
udp
Package udp implements a UDP server.
Package udp implements a UDP server.
cmd
This binary implements a stand-alone UDP server using the cloudprober/internal/servers/udp/udp package.
This binary implements a stand-alone UDP server using the cloudprober/internal/servers/udp/udp package.

Jump to

Keyboard shortcuts

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