Documentation ΒΆ
Index ΒΆ
- Constants
- type Configuration
- type DiscoveryEvent
- type DiscoveryEventType
- type Service
- func (svc *Service) GetCloudServiceId() string
- func (svc *Service) ListGraphEdges(ctx context.Context, req *discovery.ListGraphEdgesRequest) (res *discovery.ListGraphEdgesResponse, err error)
- func (svc *Service) ListResources(ctx context.Context, req *discovery.ListResourcesRequest) (res *discovery.ListResourcesResponse, err error)
- func (svc *Service) Shutdown()
- func (svc *Service) Start(ctx context.Context, req *discovery.StartDiscoveryRequest) (resp *discovery.StartDiscoveryResponse, err error)
- func (svc *Service) StartDiscovery(discoverer discovery.Discoverer)
- func (svc *Service) UpdateResource(ctx context.Context, req *discovery.UpdateResourceRequest) (res *discovery.Resource, err error)
- type ServiceOption
- func WithAssessmentAddress(target string, opts ...grpc.DialOption) ServiceOption
- func WithAuthorizationStrategy(authz service.AuthorizationStrategy) ServiceOption
- func WithCloudServiceID(ID string) ServiceOption
- func WithOAuth2Authorizer(config *clientcredentials.Config) ServiceOption
- func WithProviders(providersList []string) ServiceOption
- func WithStorage(storage persistence.Storage) 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 emitted 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 discovery.UnimplementedExperimentalDiscoveryServer Events chan *DiscoveryEvent // contains filtered or unexported fields }
Service is an implementation of the Clouditor Discovery service (plus its experimental extensions). 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) GetCloudServiceId ΒΆ added in v1.7.8
GetCloudServiceId implements CloudServiceRequest for this service. This is a little trick, so that we can call CheckAccess directly on the service. This is necessary because the discovery service itself is tied to a specific cloud service ID, instead of the individual requests that are made against the service.
func (*Service) ListGraphEdges ΒΆ added in v1.10.0
func (svc *Service) ListGraphEdges(ctx context.Context, req *discovery.ListGraphEdgesRequest) (res *discovery.ListGraphEdgesResponse, err error)
func (*Service) ListResources ΒΆ added in v1.7.8
func (svc *Service) ListResources(ctx context.Context, req *discovery.ListResourcesRequest) (res *discovery.ListResourcesResponse, err error)
func (*Service) Start ΒΆ
func (svc *Service) Start(ctx context.Context, req *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)
func (*Service) UpdateResource ΒΆ added in v1.10.0
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(target string, opts ...grpc.DialOption) ServiceOption
WithAssessmentAddress is an option to configure the assessment service gRPC address.
func WithAuthorizationStrategy ΒΆ added in v1.7.8
func WithAuthorizationStrategy(authz service.AuthorizationStrategy) ServiceOption
WithAuthorizationStrategy is an option that configures an authorization strategy to be used with this service.
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
func WithStorage ΒΆ added in v1.7.6
func WithStorage(storage persistence.Storage) ServiceOption
WithStorage is an option to set the storage. If not set, NewService will use inmemory storage.