Documentation
¶
Index ¶
- func SetXGleanConfig(sdk any, config XGleanConfig)
- type AfterErrorContext
- type AfterSuccessContext
- type AgentFileUploadHook
- type BeforeRequestContext
- type FailEarly
- type HTTPClient
- type HookContext
- type Hooks
- func (h *Hooks) AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error)
- func (h *Hooks) AfterSuccess(hookCtx AfterSuccessContext, res *http.Response) (*http.Response, error)
- func (h *Hooks) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
- func (h *Hooks) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient)
- type ServerURLNormalizerHook
- type XGleanConfig
- type XGleanHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetXGleanConfig ¶ added in v0.11.21
func SetXGleanConfig(sdk any, config XGleanConfig)
SetXGleanConfig stores the X-Glean configuration for a given SDK instance.
Types ¶
type AfterErrorContext ¶
type AfterErrorContext struct {
HookContext
}
type AfterSuccessContext ¶
type AfterSuccessContext struct {
HookContext
}
type AgentFileUploadHook ¶ added in v0.11.13
type AgentFileUploadHook struct{}
func (*AgentFileUploadHook) AfterError ¶ added in v0.11.13
func (h *AgentFileUploadHook) AfterError(hookCtx AfterErrorContext, res *http.Response, err error) (*http.Response, error)
type BeforeRequestContext ¶
type BeforeRequestContext struct {
HookContext
}
type HTTPClient ¶
HTTPClient provides an interface for supplying the SDK with a custom HTTP client
type HookContext ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (*Hooks) AfterError ¶
func (*Hooks) AfterSuccess ¶
func (*Hooks) BeforeRequest ¶
func (*Hooks) SDKInit ¶
func (h *Hooks) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient)
type ServerURLNormalizerHook ¶ added in v0.11.29
type ServerURLNormalizerHook struct{}
ServerURLNormalizerHook normalizes server URLs by prepending https:// if no scheme is provided.
func (*ServerURLNormalizerHook) SDKInit ¶ added in v0.11.29
func (h *ServerURLNormalizerHook) SDKInit(baseURL string, client HTTPClient) (string, HTTPClient)
type XGleanConfig ¶ added in v0.11.21
type XGleanConfig struct {
// ExcludeDeprecatedAfter excludes API endpoints that will be deprecated after this date.
// Format: YYYY-MM-DD (e.g., "2026-10-15")
ExcludeDeprecatedAfter string
// IncludeExperimental enables experimental API features when true.
IncludeExperimental bool
}
XGleanConfig holds configuration for X-Glean headers. This is used to pass configuration from SDK options to the hook.
func GetXGleanConfig ¶ added in v0.11.21
func GetXGleanConfig(sdk any) XGleanConfig
GetXGleanConfig retrieves the X-Glean configuration for a given SDK instance. Returns an empty config if none is set.
type XGleanHook ¶ added in v0.11.21
type XGleanHook struct{}
XGleanHook is a beforeRequest hook that sets X-Glean headers for experimental features and deprecation testing.
func (*XGleanHook) BeforeRequest ¶ added in v0.11.21
func (h *XGleanHook) BeforeRequest(hookCtx BeforeRequestContext, req *http.Request) (*http.Request, error)
BeforeRequest sets the X-Glean-Exclude-Deprecated-After and X-Glean-Experimental headers based on environment variables or SDK configuration. Environment variables take precedence over SDK options.