diagnostics

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JWKS for Azure AD
	// Source: https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration
	AzureAdJwksUri = "https://login.microsoftonline.com/common/discovery/v2.0/keys"

	AzureAdV2IssuerFormat = "https://login.microsoftonline.com/" + azureAdTenantIdToken + "/v2.0/"
	AzureAdV1IssuerFormat = "https://sts.windows.net/" + azureAdTenantIdToken + "/"
)
View Source
const (
	HealthCheckStatusHealthy   = 2
	HealthCheckStatusDegraded  = 1
	HealthCheckStatusUnhealthy = 0
)
View Source
const HealthCheckQueueName = "healthcheck"

Variables

This section is empty.

Functions

func FetchAzureADKeySet

func FetchAzureADKeySet(ctx context.Context) (jwk.Set, error)

fetchs the Azure AD key set

func GetAzureAdIssuers

func GetAzureAdIssuers(tenantId string) []string

func GetAzureCredentialObjectId

func GetAzureCredentialObjectId(ctx context.Context) (string, error)

Types

type AzureCredentialHealthCheckOptions

type AzureCredentialHealthCheckOptions struct {
	Timeout time.Duration
}

type Check

type Check func(ctx context.Context) HealthCheckResult

type FuncHealthCheckOptions

type FuncHealthCheckOptions struct {
	Timeout time.Duration
	Ready   func() bool
}

type HealthCheck

type HealthCheck interface {
	Check(ctx context.Context) HealthCheckResult
}

A health check, which can be used to check the status of a component in the application, such as a backend service, database or some internal state.

func NewAzureCredentialHealthCheck

func NewAzureCredentialHealthCheck(options AzureCredentialHealthCheckOptions) HealthCheck

func NewFuncHealthCheck

func NewFuncHealthCheck(options FuncHealthCheckOptions) HealthCheck

func NewServiceBusHealthCheck

func NewServiceBusHealthCheck(options ServiceBusHealthCheckOptions) HealthCheck

func NewUrlHealthCheck

func NewUrlHealthCheck(options UrlHealthCheckOptions) HealthCheck

type HealthCheckOptions

type HealthCheckOptions struct {
	Timeout time.Duration
}

type HealthCheckResult

type HealthCheckResult struct {
	Description string
	Status      int
	Error       error
}

type HealthCheckService

type HealthCheckService interface {
	AddHealthCheck(healthCheck HealthCheck)
	// Runs the provided health checks and returns the aggregated status.
	CheckHealth(ctx context.Context) []HealthCheckResult
}

func NewHealthCheckService

func NewHealthCheckService() HealthCheckService

type ServiceBusHealthCheckOptions

type ServiceBusHealthCheckOptions struct {
	Timeout                 time.Duration
	QueueName               string
	FullyQualifiedNamespace string
}

type UrlHealthCheckOptions

type UrlHealthCheckOptions struct {
	Timeout           time.Duration
	ReadinessFilePath string
	Url               string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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