server

package
v0.0.0-...-3736fb9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package server contains our gRPC server implementation for the ops server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	pb.UnimplementedOpsServer
	// contains filtered or unexported fields
}

API implements our gRPC server's API.

func New

func New(addr string, clients Clients, options ...Option) (*API, error)

New is the constructore for API.

func (*API) Alerts

func (a *API) Alerts(ctx context.Context, req *pb.AlertsReq) (*pb.AlertsResp, error)

Alerts grabs all currnetly firing alerts.

func (*API) ChangeSampling

func (a *API) ChangeSampling(ctx context.Context, req *pb.ChangeSamplingReq) (*pb.ChangeSamplingResp, error)

ChangeSampling changes the sampling type and rate for the Petstore.

func (*API) DeployedVersion

func (a *API) DeployedVersion(ctx context.Context, req *pb.DeployedVersionReq) (*pb.DeployedVersionResp, error)

DeployedVersion returns the version of the Petstore that prometheus says is current.

func (*API) ListTraces

func (a *API) ListTraces(ctx context.Context, req *pb.ListTracesReq) (*pb.ListTracesResp, error)

ListTraces lists recent traces from Jaeger for the petstore service.

func (*API) ShowLogs

func (a *API) ShowLogs(ctx context.Context, req *pb.ShowLogsReq) (*pb.ShowLogsResp, error)

func (*API) ShowTrace

func (a *API) ShowTrace(ctx context.Context, req *pb.ShowTraceReq) (*pb.ShowTraceResp, error)

func (*API) Start

func (a *API) Start() error

Start starts the server. This blocks until Stop() is called.

func (*API) Stop

func (a *API) Stop()

Stop stops the server.

type Clients

type Clients struct {
	// Jaeger provides access to traces.
	Jaeger *jaeger.Jaeger
	// Prom provides access to metrics.
	Prom *prom.Client
	// Petstore provides access to the petstore.
	Petstore *client.Client
}

Clients holds the remote clients requires to do ops.

type Option

type Option func(a *API)

Option is an optional arguments to New().

func WithGRPCOpts

func WithGRPCOpts(opts ...grpc.ServerOption) Option

WithGRPCOpts creates the gRPC server with the options passed.

Jump to

Keyboard shortcuts

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