server

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package server provides a ResourceDiscovery gRPC server implementation. It can either be used a standalone server, using the binary in the "cmd" subdirectory, or it can run as a part of the cloudprober binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	ListResources(req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error)
}

Provider is a resource provider, e.g. GCP provider.

type Server

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

Server implements a ResourceDiscovery gRPC server.

func New

func New(initCtx context.Context, c *configpb.ServerConf, providers map[string]Provider, l *logger.Logger) (*Server, error)

New creates a new instance of the ResourceDiscovery Server using the provided config and returns it. It also creates a net.Listener on the configured port so that we can catch port conflict errors early. TODO(manugarg): Now that we have a global gRPC server, change New() to take *grpc.Server as an argument and provide it at the time of RDS server initialization.

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the server's address, if listener has been initialized.

func (*Server) ListResources

func (s *Server) ListResources(ctx context.Context, req *pb.ListResourcesRequest) (*pb.ListResourcesResponse, error)

ListResources implements the ListResources method of the ResourceDiscovery service.

func (*Server) Start

func (s *Server) Start(ctx context.Context, dataChan chan<- *metrics.EventMetrics)

Start starts the gRPC server. It returns only when the provided is canceled or server panics.

Directories

Path Synopsis
This binary implements a stand-alone ResourceDiscovery server.
This binary implements a stand-alone ResourceDiscovery server.
Package filter implements common filters for the RDS (resource discovery service) providers.
Package filter implements common filters for the RDS (resource discovery service) providers.
gcp
Package gcp implements a GCP (Google Compute Platform) resources provider for ResourceDiscovery server.
Package gcp implements a GCP (Google Compute Platform) resources provider for ResourceDiscovery server.

Jump to

Keyboard shortcuts

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