discovery

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderAWS   = "aws"
	ProviderK8S   = "k8s"
	ProviderAzure = "azure"
)
View Source
const (
	// DefaultAssessmentAddress specifies the default gRPC address of the assessment service.
	DefaultAssessmentAddress = "localhost:9090"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration added in v1.3.6

type Configuration struct {
	Interval time.Duration
}

type DiscoveryEvent added in v1.6.2

type DiscoveryEvent struct {
	Type            DiscoveryEventType
	DiscovererName  string
	DiscoveredItems int
	Time            time.Time
}

DiscoveryEvent represents an event that is ommited if certain situations happen in the discoverer (defined by DiscoveryEventType). Examples would be the start or the end of the discovery. We will potentially expand this in the future.

type DiscoveryEventType added in v1.6.2

type DiscoveryEventType int

DiscoveryEventType defines the event types for DiscoveryEvent.

const (
	// DiscovererStart is emmited at the start of a discovery run.
	DiscovererStart DiscoveryEventType = iota
	// DiscovererFinished is emmited at the end of a discovery run.
	DiscovererFinished
)

type Service

type Service struct {
	discovery.UnimplementedDiscoveryServer

	Events chan *DiscoveryEvent
	// contains filtered or unexported fields
}

Service is an implementation of the Clouditor Discovery service. It should not be used directly, but rather the NewService constructor should be used.

func NewService added in v1.3.3

func NewService(opts ...ServiceOption) *Service

func (*Service) Authorizer added in v1.4.0

func (svc *Service) Authorizer() api.Authorizer

Authorizer implements UsesAuthorizer.

func (*Service) Query added in v1.3.2

func (svc *Service) Query(_ context.Context, req *discovery.QueryRequest) (res *discovery.QueryResponse, err error)

func (*Service) SetAuthorizer added in v1.4.0

func (svc *Service) SetAuthorizer(auth api.Authorizer)

SetAuthorizer implements UsesAuthorizer.

func (*Service) Shutdown added in v1.3.4

func (svc *Service) Shutdown()

func (*Service) Start

Start starts discovery

func (*Service) StartDiscovery added in v1.3.3

func (svc *Service) StartDiscovery(discoverer discovery.Discoverer)

type ServiceOption added in v1.3.14

type ServiceOption func(*Service)

ServiceOption is a functional option type to configure the discovery service.

func WithAssessmentAddress added in v1.3.14

func WithAssessmentAddress(address string, opts ...grpc.DialOption) ServiceOption

WithAssessmentAddress is an option to configure the assessment service gRPC address.

func WithCloudServiceID added in v1.6.2

func WithCloudServiceID(ID string) ServiceOption

WithCloudServiceID is an option to configure the cloud service ID for which resources will be discovered.

func WithOAuth2Authorizer added in v1.4.0

func WithOAuth2Authorizer(config *clientcredentials.Config) ServiceOption

WithOAuth2Authorizer is an option to use an OAuth 2.0 authorizer

func WithProviders added in v1.4.0

func WithProviders(providersList []string) ServiceOption

WithProviders is an option to set providers for discovering

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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