Skip to content

Conversation

@eliasjf
Copy link
Collaborator

@eliasjf eliasjf commented Nov 2, 2023

This PR exposes additional methods to set and get data from the session cache. It also extends the Godoc to cover the case of a key not being found.

@eliasjf eliasjf requested review from gramidt and wfernandes November 2, 2023 23:41
Copy link
Contributor

@kewun kewun left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Member

@wfernandes wfernandes left a comment

Choose a reason for hiding this comment

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

lgtm.
One minor comment that hopefully moves us towards the direction of forcing service extension authors to handle errors.

type Provider interface {
// GetString returns a session value based on the provided key.
// GetString returns a session value based on the provided key. If the key does
// not exist, the default or zero value will be returned (i.e, "").
Copy link
Member

Choose a reason for hiding this comment

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

Should we start returning errors 😉 ? Like ErrNotFound and make that available in this pacakge?

@troytop troytop merged commit 73721ce into main Nov 3, 2023
@troytop troytop deleted the feature/session-methods branch November 3, 2023 21:45
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.

5 participants