resource

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceUnmarshaller

type ResourceUnmarshaller interface {
	Unmarshal(raw []byte) (interface{}, error)
}

ResourceUnmarshaller defines the interface for unmarshalling fetched data. This interface works with any data format (JSON, XML, etc.).

type SyncedResource

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

SyncedResource provides automatic fetching and caching of remote data with TTL-based refresh. It works with any data format via the ResourceUnmarshaller interface. It's used for JWKS (JSON), SAML metadata (XML), OIDC configuration (JSON), and other synced data. The sync goroutine exits when the provided context is cancelled.

func NewSyncedResource

func NewSyncedResource(
	ctx context.Context, file, fileContext, uri string, transport http.RoundTripper, roundTripName string,
	ttl time.Duration, maxStale time.Duration, unmarshaller ResourceUnmarshaller, log *logrus.Entry) (*SyncedResource, error)

func (*SyncedResource) Data

func (s *SyncedResource) Data() (interface{}, error)

Jump to

Keyboard shortcuts

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