Documentation
¶
Index ¶
- Constants
- Variables
- func EventFromRecord(record *ActivityLogEventRecord) *entities.Event
- func EventIsForSource(event *ActivityLogEventRecord, resourceType string) bool
- func EventSourceFromEvent(event *ActivityLogEventRecord) string
- func RelationshipFromID(id string) []string
- type ActivityLogEventData
- type ActivityLogEventRecord
- type AuthConfig
- type Client
- type ClientInterface
- type EventConsumer
- type EventHubConfig
- type EventType
- type GraphClient
- type GraphClientInterface
- type GraphLiveData
- type Resource
Constants ¶
View Source
const ( StorageAccountEventSource = "microsoft.storage/storageaccounts" WebSitesEventSource = "microsoft.web/sites" ComputeVirtualMachineEventSource = "microsoft.compute/virtualmachines" ComputeDiskEventSource = "microsoft.compute/disks" VirtualNetworkEventSource = "microsoft.network/virtualnetworks" NetworkInterfaceEventSource = "microsoft.network/networkinterfaces" NetworkSecurityGroupEventSource = "microsoft.network/networksecuritygroups" NetworkPublicIPAddressEventSource = "microsoft.network/publicipaddresses" TagsEventSource = "microsoft.resources/tags" )
Variables ¶
View Source
var ( ErrAzureClientSecretCredential = errors.New("failed to create an Azure client secret credential") ErrAzureDefaultCredential = errors.New("failed to create a default Azure credential") ErrMissingSubscriptionID = errors.New("subscriptionId is required") ErrIncompleteAuthConfigForTenantID = errors.New("both clientId and clientSecret are required when tenantId is provided") ErrIncompleteAuthConfigForClientID = errors.New("both tenantId and clientSecret are required when clientId is provided") ErrIncompleteAuthConfigForClientSecret = errors.New("both tenantId and clientId are required when clientSecret is provided") ErrEventHubNamespaceRequired = errors.New("eventHubNamespace is required") ErrEventHubNameRequired = errors.New("eventHubName is required") ErrCheckpointStorageAccountNameRequired = errors.New("checkpointStorageAccountName is required") ErrCheckpointStorageContainerNameRequired = errors.New("checkpointStorageContainerName is required") )
View Source
var (
ErrClientInitialization = errors.New("failed to initialize Azure client")
)
Functions ¶
func EventFromRecord ¶
func EventFromRecord(record *ActivityLogEventRecord) *entities.Event
func EventIsForSource ¶
func EventIsForSource(event *ActivityLogEventRecord, resourceType string) bool
func EventSourceFromEvent ¶ added in v0.5.2
func EventSourceFromEvent(event *ActivityLogEventRecord) string
func RelationshipFromID ¶
Types ¶
type ActivityLogEventData ¶
type ActivityLogEventData struct {
Records []*ActivityLogEventRecord `json:"records,omitempty"`
}
type ActivityLogEventRecord ¶
type ActivityLogEventRecord struct {
RoleLocation string `json:"RoleLocation,omitempty"` //nolint:tagliatelle
Stamp string `json:"Stamp,omitempty"` //nolint:tagliatelle
ReleaseVersion string `json:"ReleaseVersion,omitempty"` //nolint:tagliatelle
Time string `json:"time,omitempty"`
ResourceID string `json:"resourceId,omitempty"`
OperationName string `json:"operationName,omitempty"`
Category string `json:"category,omitempty"`
ResultType string `json:"resultType,omitempty"`
ResultSignature string `json:"resultSignature,omitempty"`
DurationMs string `json:"durationMs,omitempty"`
CallerIPAddress string `json:"callerIpAddress,omitempty"`
CorrelationID string `json:"correlationId,omitempty"`
Level string `json:"level,omitempty"`
Properties map[string]any `json:"properties,omitempty"`
}
type AuthConfig ¶
type AuthConfig struct {
SubscriptionID string `json:"subscriptionId,omitempty"`
TenantID string `json:"tenantId,omitempty"`
ClientID config.SecretSource `json:"clientId,omitempty"`
ClientSecret config.SecretSource `json:"clientSecret,omitempty"`
}
func (*AuthConfig) AzureTokenProvider ¶
func (c *AuthConfig) AzureTokenProvider() (azcore.TokenCredential, error)
func (*AuthConfig) Validate ¶
func (c *AuthConfig) Validate() error
type ClientInterface ¶
type ClientInterface interface {
GetByID(ctx context.Context, resourceID, apiVersion string) (*Resource, error)
}
func NewClient ¶
func NewClient(config AuthConfig) (ClientInterface, error)
type EventConsumer ¶
type EventConsumer func(event *azeventhubs.ReceivedEventData) error
type EventHubConfig ¶
type EventHubConfig struct {
AuthConfig
EventHubNamespace string `json:"eventHubNamespace,omitempty"`
EventHubName string `json:"eventHubName,omitempty"`
CheckpointStorageAccountName string `json:"checkpointStorageAccountName,omitempty"`
CheckpointStorageContainerName string `json:"checkpointStorageContainerName,omitempty"`
EventConsumer EventConsumer `json:"-"`
}
func (*EventHubConfig) Validate ¶
func (c *EventHubConfig) Validate() error
type GraphClient ¶
type GraphClient struct {
// contains filtered or unexported fields
}
type GraphClientInterface ¶
type GraphClientInterface interface {
Resources(ctx context.Context, typesToFilter []string) ([]*entities.Event, error)
}
func NewGraphClient ¶
func NewGraphClient(config AuthConfig) (GraphClientInterface, error)
type GraphLiveData ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.