Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ctx propagation on all lib functions #4

Merged
merged 4 commits into from
Jan 28, 2024

Conversation

neymarjimoh
Copy link
Contributor

Enhancing the lib functions to include context for increased user controls would be valuable. This would give the end developer utilizing this library more control from within their applications.

payload := fastotp.GenerateOTPPayload{
    Delivery: OtpDelivery{
      "email": "[email protected]",
    },
		Identifier:  "user123",
		TokenLength: 6,
		Type:        "numeric",
		Validity:    120,
	}

// Generate OTP
otp, err := client.GenerateOTP(ctx, payload)
// ... I can cancel or set timeout based on my business rules

Copy link
Contributor

@LordRahl90 LordRahl90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work,
However, there's no need to expose the values in the APIClient.

lib/http.go Outdated Show resolved Hide resolved
@neymarjimoh
Copy link
Contributor Author

Great work, However, there's no need to expose the values in the APIClient.

Thanks for the feedback. I agree that exposing BaseURL and APIKey directly may not be ideal. I just added the Ctx key for managing user's context that's why and noticed your PR handled that. Will modify now

go.mod Outdated Show resolved Hide resolved
@LordRahl90
Copy link
Contributor

Great work, However, there's no need to expose the values in the APIClient.

Thanks for the feedback. I agree that exposing BaseURL and APIKey directly may not be ideal. I just added the Ctx key for managing user's context that's why and noticed your PR handled that. Will modify now

Great work boss 🙇‍♂️

@neymarjimoh
Copy link
Contributor Author

Great work, However, there's no need to expose the values in the APIClient.

Thanks for the feedback. I agree that exposing BaseURL and APIKey directly may not be ideal. I just added the Ctx key for managing user's context that's why and noticed your PR handled that. Will modify now

Great work boss 🙇‍♂️

Thanks boss

@neymarjimoh neymarjimoh reopened this Jan 28, 2024
@neymarjimoh neymarjimoh requested a review from CeoFred January 28, 2024 04:22
@CeoFred CeoFred merged commit 93aaa2d into CeoFred:main Jan 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants