global

package
v0.0.7-beta Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const BEARER_TOKEN_REFRESH_INTERVAL = 20 * time.Hour

Set to less than the maximum duration of the Auth0 Bearer Token

View Source
const BEARER_TOKEN_REFRESH_JITTER = 600 // seconds
View Source
const GUARD_CONFIG_REFRESH_INTERVAL = 30 * time.Second

Set to how often we poll Hub for a new Guard Config

View Source
const GUARD_CONFIG_REFRESH_JITTER = 6 // seconds
View Source
const (
	MIN_POLLING_TIME = 15 * time.Second
)
View Source
const SERVICE_CONFIG_REFRESH_INTERVAL = 30 * time.Second

Set to how often we poll Hub for a new Service Config

View Source
const SERVICE_CONFIG_REFRESH_JITTER = 6 // seconds

Variables

This section is empty.

Functions

func GetClientID

func GetClientID() string

func GetCustomerID

func GetCustomerID() string

func GetGuardConfig

func GetGuardConfig(ctx context.Context, guard string) (*hubv1.GuardConfig, hubv1.Config, error)

func GetGuardConfigs

func GetGuardConfigs(ctx context.Context, skipPoll bool)

func GetServiceConfig

func GetServiceConfig(ctx context.Context, skipPoll bool)

func GetServiceEnvironment

func GetServiceEnvironment() string

func GetServiceKey

func GetServiceKey() string

func GetServiceName

func GetServiceName() string

func GetServiceRelease

func GetServiceRelease() string

func GetStanzaTracer

func GetStanzaTracer() *trace.Tracer

func InstrumentationMetricVersion

func InstrumentationMetricVersion() metric.MeterOption

func InstrumentationName

func InstrumentationName() string

func InstrumentationTraceVersion

func InstrumentationTraceVersion() trace.TracerOption

func NewStanzaTracer

func NewStanzaTracer() *trace.Tracer

func NewState

func NewState(ctx context.Context, hubUri, svcKey, svcName, svcEnv, svcRel string, guards []string) func()

func OtelEnabled

func OtelEnabled() bool

func OtelStartup

func OtelStartup(ctx context.Context, skipPoll bool)

func QuotaServiceClient

func QuotaServiceClient() hubv1grpc.QuotaServiceClient

func SentinelEnabled

func SentinelEnabled() bool

func SentinelStartup

func SentinelStartup(ctx context.Context)

func UserAgent

func UserAgent() string

func XStanzaKey

func XStanzaKey() metadata.MD

Types

type StanzaMeter

type StanzaMeter struct {
	AllowedCount        metric.Int64Counter
	AllowedSuccessCount metric.Int64Counter
	AllowedFailureCount metric.Int64Counter
	AllowedUnknownCount metric.Int64Counter
	AllowedDuration     metric.Float64Histogram
	BlockedCount        metric.Int64Counter
	FailOpenCount       metric.Int64Counter
}

func GetStanzaMeter

func GetStanzaMeter() *StanzaMeter

func NewStanzaMeter

func NewStanzaMeter() *StanzaMeter

Jump to

Keyboard shortcuts

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