Skip to content

Commit

Permalink
Implement Close() method to close the session
Browse files Browse the repository at this point in the history
  • Loading branch information
user340 committed Sep 5, 2022
1 parent ce406f5 commit e38e8df
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 e38e8df

Please sign in to comment.