Documentation
¶
Index ¶
- Constants
- type Configuration
- type DiscoveryEvent
- type DiscoveryEventType
- type Service
- func (svc *Service) Authorizer() api.Authorizer
- func (svc *Service) Query(_ context.Context, req *discovery.QueryRequest) (res *discovery.QueryResponse, err error)
- func (svc *Service) SetAuthorizer(auth api.Authorizer)
- func (svc *Service) Shutdown()
- func (svc *Service) Start(_ context.Context, _ *discovery.StartDiscoveryRequest) (resp *discovery.StartDiscoveryResponse, err error)
- func (svc *Service) StartDiscovery(discoverer discovery.Discoverer)
- type ServiceOption
Constants ¶
const ( ProviderAWS = "aws" ProviderK8S = "k8s" ProviderAzure = "azure" )
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 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) Start ¶
func (svc *Service) Start(_ context.Context, _ *discovery.StartDiscoveryRequest) (resp *discovery.StartDiscoveryResponse, err error)
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