MCPcopy
hub / github.com/kubernetes/client-go / cachedGetter

Struct cachedGetter

plugin/pkg/client/auth/openstack/openstack.go:82–89  ·  view source on GitHub ↗

cachedGetter caches a token until it gets expired, after the expiration, it will generate another token and cache it.

Source from the content-addressed store, hash-verified

80// cachedGetter caches a token until it gets expired, after the expiration, it will
81// generate another token and cache it.
82type cachedGetter struct {
83 mutex sync.Mutex
84 tokenGetter TokenGetter
85
86 token string
87 born time.Time
88 ttl time.Duration
89}
90
91// Token returns the current available token, create a new one if expired.
92func (c *cachedGetter) Token() (string, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected