Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGraphClient

func NewGraphClient(accessToken string, expiresOn time.Time, ipv4Only bool) (*msgraphsdk.GraphServiceClient, error)

NewGraphClient creates an authenticated msgraph-sdk-go client from a raw access token. Uses .default scope for the auth provider (fine for static tokens).

func NewGraphClientWithCredential added in v0.2.0

func NewGraphClientWithCredential(cred azcore.TokenCredential, scopes []string, ipv4Only bool) (*msgraphsdk.GraphServiceClient, error)

NewGraphClientWithCredential creates an authenticated msgraph-sdk-go client from a live azcore.TokenCredential with explicit scopes. For MSAL-backed credentials, the scopes MUST match what was used during login so that MSAL can find cached tokens and silently refresh using the stored refresh token.

func NewIPv4HTTPClient

func NewIPv4HTTPClient() *http.Client

NewIPv4HTTPClient returns an *http.Client with IPv4-only transport. This satisfies azcore's policy.Transporter interface (has Do method) and can be used as azcore.ClientOptions.Transport.

func NewIPv4Transport

func NewIPv4Transport() *http.Transport

NewIPv4Transport returns an http.Transport that only resolves IPv4 addresses. Useful for cloud regions with broken IPv6 egress (e.g. some Azure regions).

Types

type StaticTokenCredential

type StaticTokenCredential struct {
	// contains filtered or unexported fields
}

StaticTokenCredential wraps a pre-acquired access token as an azcore.TokenCredential. SECURITY: The token is only held in memory and never logged.

func (*StaticTokenCredential) GetToken

GetToken returns the stored access token.

Jump to

Keyboard shortcuts

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