MCPcopy
hub / github.com/golang-jwt/jwt / WithTimeFunc

Function WithTimeFunc

parser_option.go:45–49  ·  view source on GitHub ↗

WithTimeFunc returns the ParserOption for specifying the time func. The primary use-case for this is testing. If you are looking for a way to account for clock-skew, WithLeeway should be used instead.

(f func() time.Time)

Source from the content-addressed store, hash-verified

43// primary use-case for this is testing. If you are looking for a way to account
44// for clock-skew, WithLeeway should be used instead.
45func WithTimeFunc(f func() time.Time) ParserOption {
46 return func(p *Parser) {
47 p.validator.timeFunc = f
48 }
49}
50
51// WithIssuedAt returns the ParserOption to enable verification
52// of issued-at.

Calls

no outgoing calls