common

package
v0.11.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GraphSDKMutex sync.Mutex

GraphSDKMutex is a global lock used to serialize Microsoft Graph SDK (Kiota) API calls.

Reason: Kiota's middleware (e.g., HeadersInspectionHandler) modifies shared header maps during HTTP request processing. In Go, maps are not concurrency-safe — concurrent writes cause immediate fatal runtime panics ("concurrent map writes").

Terraform executes Read operations across multiple resources in parallel, leading to multiple Graph API calls at the same time. Without locking, simultaneous mutation of the shared headers map causes the plugin to crash.

By acquiring this mutex around Graph API calls (Get, Post, Patch, Delete), we ensure only one request is processed at a time through the Kiota pipeline, preventing concurrency issues and plugin crashes.

Functions

func SetGraphBetaClientForDataSource

func SetGraphBetaClientForDataSource(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse, dataSourceName string) *msgraphbetasdk.GraphServiceClient

SetGraphBetaClientForDataSource is a helper function to retrieve and validate the Graph Beta client for data sources.

func SetGraphBetaClientForResource

func SetGraphBetaClientForResource(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse, resourceName string) *msgraphbetasdk.GraphServiceClient

SetGraphBetaClientForResource is a helper function to retrieve and validate the Graph Beta client for resources.

func SetGraphStableClientForDataSource

func SetGraphStableClientForDataSource(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse, dataSourceName string) *msgraphsdk.GraphServiceClient

SetGraphStableClientForDataSource is a helper function to retrieve and validate the Graph Stable client for data sources.

func SetGraphStableClientForResource

func SetGraphStableClientForResource(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse, resourceName string) *msgraphsdk.GraphServiceClient

SetGraphStableClientForResource is a helper function to retrieve and validate the Graph Stable client for resources.

Types

This section is empty.

Directories

Path Synopsis
planmodifiers/bool.go
planmodifiers/bool.go
shared_models
graph_beta/device_and_app_management
Base resource REF: https://learn.microsoft.com/en-us/graph/api/resources/intune-apps-mobileappassignment?view=graph-rest-beta
Base resource REF: https://learn.microsoft.com/en-us/graph/api/resources/intune-apps-mobileappassignment?view=graph-rest-beta
graph_beta/device_management
REF: https://learn.microsoft.com/en-us/graph/api/resources/intune-rbac-roleassignment?view=graph-rest-beta
REF: https://learn.microsoft.com/en-us/graph/api/resources/intune-rbac-roleassignment?view=graph-rest-beta

Jump to

Keyboard shortcuts

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