Skip to content

Commit

Permalink
Merge pull request #7 from miraclelinux/develop/implement-user-logout
Browse files Browse the repository at this point in the history
Implement Close() method to close the session
  • Loading branch information
user340 committed Oct 28, 2022
2 parents ce406f5 + e38e8df commit 2a49475
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,13 @@ func (c *Session) Get(method string, params interface{}, v interface{}) error {

return nil
}

// Close calls "user.logout" API to close the session.
func (c *Session) Close() error {
_, err := c.Do(NewRequest("user.logout", nil))
if err != nil {
return err
}

return nil
}

0 comments on commit 2a49475

Please sign in to comment.