Versions in this module Expand all Collapse all v0 v0.0.1 Jan 2, 2024 Changes in this version + const Authority + const DefaultBaseDomain + const DefaultTimeout + const EvaluationInterval + const MaxConcurrency + const MinConcurrency + const SDKVersion + const Scope + const TokenInvalidateEndpoint + const UserAgentBase + func CheckDeprecationHeader(resp *http.Response, logger Logger) + func EnsureHTTPScheme(url string) string + func GetAuthCredentialsFromEnv() map[string]string + func GetUserAgentHeader() string + func LoadUserConfig(filename string) error + func Min(a, b int) int + func ParseISO8601Date(dateStr string) (time.Time, error) + type APIError struct + Message string + StatusCode int + func (e *APIError) Error() string + type APIHandler interface + GetAcceptHeader func() string + GetContentTypeHeader func(method string) string + MarshalMultipartRequest func(fields map[string]string, files map[string]string) ([]byte, string, error) + MarshalRequest func(body interface{}, method string, endpoint string) ([]byte, error) + SetLogger func(logger Logger) + UnmarshalResponse func(resp *http.Response, out interface{}) error + func GetAPIHandler(config Config) APIHandler + type Client struct + AuthMethod string + ConcurrencyMgr *ConcurrencyManager + Expiry time.Time + OAuthCredentials OAuthCredentials + OverrideBaseDomain string + PerfMetrics ClientPerformanceMetrics + TenantID string + TenantName string + Token string + func NewClient(config Config, clientAuthConfig *ClientAuthConfig, logger Logger, ...) (*Client, error) + func (c *Client) AdjustConcurrencyBasedOnMetrics() + func (c *Client) AverageAcquisitionTime() time.Duration + func (c *Client) ConstructMSGraphAPIEndpoint(endpointPath string) string + func (c *Client) Delete(endpoint string, out interface{}) (*http.Response, error) + func (c *Client) DoMultipartRequest(method, endpoint string, fields map[string]string, files map[string]string, ...) (*http.Response, error) + func (c *Client) DoRequest(method, endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) EvaluateMetricsAndAdjustConcurrency() + func (c *Client) Get(endpoint string, out interface{}) (*http.Response, error) + func (c *Client) GetOAuthCredentials() OAuthCredentials + func (c *Client) GetPerformanceMetrics() *ClientPerformanceMetrics + func (c *Client) HistoricalAverageAcquisitionTime() time.Duration + func (c *Client) ObtainOauthTokenWithApp(tenantID, clientID, clientSecret string) (*OAuthResponse, error) + func (c *Client) ObtainOauthTokenWithCertificate(tenantID, clientID, thumbprint, keyFile string) (*OAuthResponse, error) + func (c *Client) Patch(endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) Post(endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) Put(endpoint string, body, out interface{}) (*http.Response, error) + func (c *Client) SetGraphAuthenticationMethod(creds map[string]string) + func (c *Client) StartConcurrencyAdjustment() + func (c *Client) StartMetricEvaluation() + func (c *Client) ValidAuthTokenCheck() (bool, error) + type ClientAuthConfig struct + CertThumbprint string + CertificateKeyPath string + CertificatePath string + ClientID string + ClientSecret string + Password string + TenantID string + TenantName string + Username string + func LoadClientAuthConfig(filename string) (*ClientAuthConfig, error) + type ClientOption func(*Client) + type ClientPerformanceMetrics struct + TokenWaitTime time.Duration + TotalRateLimitErrors int64 + TotalRequests int64 + TotalResponseTime time.Duration + TotalRetries int64 + type ConcurrencyManager struct + AcquisitionTimes []time.Duration + func NewConcurrencyManager(limit int, logger Logger, debugMode bool) *ConcurrencyManager + func (c *ConcurrencyManager) Acquire(ctx context.Context) (uuid.UUID, error) + func (c *ConcurrencyManager) AdjustConcurrencyLimit(newLimit int) + func (c *ConcurrencyManager) AverageAcquisitionTime() time.Duration + func (c *ConcurrencyManager) HistoricalAverageAcquisitionTime() time.Duration + func (c *ConcurrencyManager) Release(requestID uuid.UUID) + type Config struct + EnableDynamicRateLimiting bool + LogLevel LogLevel + Logger Logger + MaxConcurrentRequests int + MaxRetryAttempts int + TokenLifespan time.Duration + TokenRefreshBufferPeriod time.Duration + TotalRetryDuration time.Duration + type ConfigMap map[string]EndpointConfig + type EndpointConfig struct + Accept string + ContentType *string + type LogLevel int + const LogLevelDebug + const LogLevelInfo + const LogLevelNone + const LogLevelWarning + type Logger interface + Debug func(msg string, keysAndValues ...interface{}) + Error func(msg string, keysAndValues ...interface{}) + Fatal func(msg string, keysAndValues ...interface{}) + Info func(msg string, keysAndValues ...interface{}) + SetLevel func(level LogLevel) + Trace func(msg string, keysAndValues ...interface{}) + Warn func(msg string, keysAndValues ...interface{}) + func NewDefaultLogger() Logger + type OAuthCredentials struct + CertThumbprint string + CertificateKeyPath string + CertificatePath string + ClientID string + ClientSecret string + type OAuthResponse struct + AccessToken string + Error string + ExpiresIn int64 + RefreshToken string + TokenType string + type StructuredError struct + Error struct{ ... } + type TokenResponse struct + Expires time.Time + Token string + type UnifiedGraphAPIHandler struct + func (u *UnifiedGraphAPIHandler) GetAcceptHeader() string + func (u *UnifiedGraphAPIHandler) GetContentTypeHeader(endpoint string) string + func (u *UnifiedGraphAPIHandler) MarshalMultipartRequest(fields map[string]string, files map[string]string) ([]byte, string, error) + func (u *UnifiedGraphAPIHandler) MarshalRequest(body interface{}, method string, endpoint string) ([]byte, error) + func (u *UnifiedGraphAPIHandler) SetLogger(logger Logger) + func (u *UnifiedGraphAPIHandler) UnmarshalResponse(resp *http.Response, out interface{}) error