Skip to content

Commit

Permalink
Add GetBool and SetBool (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniilstrata authored Dec 5, 2023
1 parent 6a2a289 commit f662d1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ type Provider interface {
// not exist, the default or zero value will be returned (i.e, "").
GetString(key string) (string, error)

// GetBool 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, false).
GetBool(key string) (bool, error)

// GetBytes returns the []byte for a given key from the session data. If the key
// does not exist, the default or zero value will be returned (i.e, nil).
GetBytes(key string) ([]byte, error)
Expand All @@ -28,6 +32,9 @@ type Provider interface {
// SetString adds a key and the corresponding string value to the session data.
SetString(key string, value string) error

// SetBool adds a key and the corresponding boolean value to the session data.
SetBool(key string, value bool) error

// SetBytes adds a key and the corresponding []byte value to the session data.
SetBytes(key string, value []byte) error

Expand Down

0 comments on commit f662d1a

Please sign in to comment.