babysitter

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Babysitter

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

Babysitter starts and manages a weavelet inside the Pod.

func Start added in v0.18.0

func Start(
	ctx context.Context,
	logger *slog.Logger,
	cfg *config.GKEConfig,
	replicaSet string,
	projectName string,
	podName string,
	internalAddress string,
	mux *http.ServeMux,
	selfAddr string,
	manager endpoints.Manager,
	caCert *x509.Certificate,
	getSelfCert func() ([]byte, []byte, error),
	newReplicaWatcher func(context.Context, string) (ReplicaWatcher, error),
	logSaver func(*protos.LogEntry),
	traceSaver func(spans *protos.TraceSpans) error,
	metricExporter func(metrics []*metrics.MetricSnapshot) error,
) (*Babysitter, error)

Start creates and starts a new babysitter.

func (*Babysitter) ActivateComponent added in v0.2.0

ActivateComponent implements the envelope.EnvelopeHandler interface.

func (*Babysitter) CheckHealth

CheckHealth implements the endpoints.Babysitter interface.

func (*Babysitter) ExportListener added in v0.2.0

ExportListener implements the envelope.EnvelopeHandler interface.

func (*Babysitter) GetListenerAddress added in v0.2.0

GetListenerAddress implements the envelope.EnvelopeHandler interface.

func (*Babysitter) GetSelfCertificate added in v0.12.0

func (*Babysitter) HandleLogEntry added in v0.2.0

func (b *Babysitter) HandleLogEntry(_ context.Context, entry *protos.LogEntry) error

HandleLogEntry implements the envelope.EnvelopeHandler interface.

func (*Babysitter) HandleTraceSpans added in v0.2.0

func (b *Babysitter) HandleTraceSpans(_ context.Context, traces *protos.TraceSpans) error

HandleTraceSpans implements the envelope.EnvelopeHandler interface.

func (*Babysitter) RunProfiling

RunProfiling implements the endpoints.Babysitter interface.

func (*Babysitter) VerifyClientCertificate added in v0.7.0

VerifyClientCertificate implements the envelope.EnvelopeHandler interface.

func (*Babysitter) VerifyServerCertificate added in v0.7.0

VerifyServerCertificate implements the envelope.EnvelopeHandler interface.

func (*Babysitter) WeaveletInfo added in v0.18.3

func (b *Babysitter) WeaveletInfo() *protos.WeaveletInfo

WeaveletInfo returns information about the weavelet managed by the babysitter.

type HttpClient

type HttpClient struct {
	Addr      string      // babysitter address
	TLSConfig *tls.Config // TLS config, possibly nil.
}

HttpClient is a Client that executes requests over HTTP.

func (*HttpClient) CheckHealth

CheckHealth implements the endpoints.Babysitter interface.

func (*HttpClient) RunProfiling

RunProfiling implements the endpoints.Babysitter interface.

type ReplicaWatcher added in v0.18.3

type ReplicaWatcher interface {
	// GetReplicas returns addresses of all replicas in a given replica set.
	// If there have been no changes since the last call to GetReplicas(),
	// this method will block.
	GetReplicas(context.Context) ([]string, error)
}

ReplicaWatcher maintains an up-to-date information about replicas in a ReplicaSet.

Jump to

Keyboard shortcuts

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