package tokens import ( "context" "time" ) type Token[T any] struct { Key string ExpiresAt time.Time Data T } type Store[T any] interface { // Put stores data under the given key with a configured expiration. // If the key already exists, it is replaced (upsert). Put(ctx context.Context, key string, data T) (*Token[T], error) // Get retrieves a token by key without consuming it. // Returns core.ErrNotFound if the key doesn't exist or has expired. Get(ctx context.Context, key string) (*Token[T], error) // Delete removes a token by key. Delete(ctx context.Context, key string) error }