Skip to content

Fixed Destory typo #29

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion couchbase/couchbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (p *CouchbaseProvider) Exist(sid string) bool {
}
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *CouchbaseProvider) Destory(sid string) error {
p.b = p.getBucket()
defer p.b.Close()
Expand Down
2 changes: 1 addition & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (p *FileProvider) Exist(sid string) bool {
return com.IsFile(p.filepath(sid))
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *FileProvider) Destory(sid string) error {
p.lock.Lock()
defer p.lock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion ledis/ledis.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (p *LedisProvider) Exist(sid string) bool {
return err == nil && count > 0
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *LedisProvider) Destory(sid string) error {
_, err := p.c.Del([]byte(sid))
return err
Expand Down
2 changes: 1 addition & 1 deletion memcache/memcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (p *MemcacheProvider) Exist(sid string) bool {
return err == nil
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *MemcacheProvider) Destory(sid string) error {
return p.c.Delete(sid)
}
Expand Down
4 changes: 2 additions & 2 deletions memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type MemProvider struct {
lock sync.RWMutex
maxLifetime int64
data map[string]*list.Element
// A priority list whose lastAccess newer gets higer priority.
// A priority list whose lastAccess newer gets higher priority.
list *list.List
}

Expand Down Expand Up @@ -145,7 +145,7 @@ func (p *MemProvider) Exist(sid string) bool {
return ok
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *MemProvider) Destory(sid string) error {
p.lock.Lock()
defer p.lock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (p *MysqlProvider) Exist(sid string) bool {
return err != sql.ErrNoRows
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *MysqlProvider) Destory(sid string) error {
_, err := p.c.Exec("DELETE FROM session WHERE `key`=?", sid)
return err
Expand Down
2 changes: 1 addition & 1 deletion nodb/nodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (p *NodbProvider) Exist(sid string) bool {
return err == nil && count > 0
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *NodbProvider) Destory(sid string) error {
_, err := p.c.Del([]byte(sid))
return err
Expand Down
2 changes: 1 addition & 1 deletion postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (p *PostgresProvider) Exist(sid string) bool {
return err != sql.ErrNoRows
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *PostgresProvider) Destory(sid string) error {
_, err := p.c.Exec("DELETE FROM session WHERE key=$1", sid)
return err
Expand Down
2 changes: 1 addition & 1 deletion redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (p *RedisProvider) Exist(sid string) bool {
return err == nil && has
}

// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
func (p *RedisProvider) Destory(sid string) error {
return p.c.Del(p.prefix + sid).Err()
}
Expand Down
6 changes: 3 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type Store interface {
RawStore
// Read returns raw session store by session ID.
Read(string) (RawStore, error)
// Destory deletes a session.
// Destroy deletes a session.
Destory(*macaron.Context) error
// RegenerateId regenerates a session store from old session ID to new one.
RegenerateId(*macaron.Context) (RawStore, error)
Expand Down Expand Up @@ -209,7 +209,7 @@ type Provider interface {
Read(sid string) (RawStore, error)
// Exist returns true if session with given ID exists.
Exist(sid string) bool
// Destory deletes a session by session ID.
// Destroy deletes a session by session ID.
Destory(sid string) error
// Regenerate regenerates a session store from old session ID to new one.
Regenerate(oldsid, sid string) (RawStore, error)
Expand Down Expand Up @@ -318,7 +318,7 @@ func (m *Manager) Read(sid string) (RawStore, error) {
return m.provider.Read(sid)
}

// Destory deletes a session by given ID.
// Destroy deletes a session by given ID.
func (m *Manager) Destory(ctx *macaron.Context) error {
sid := ctx.GetCookie(m.opt.CookieName)
if len(sid) == 0 {
Expand Down