{"modulePath":"github.com/go-macaron/session","version":"v1.0.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package session\n\n## Types\n\n```go\ntype PostgresProvider struct {\n\t// contains filtered or unexported fields\n}\n```\nPostgresProvider represents a postgres session provider implementation.\n\n```go\nfunc (p *PostgresProvider) Count() (total int)\n```\nCount counts and returns number of sessions.\n\n```go\nfunc (p *PostgresProvider) Destory(sid string) error\n```\nDestory deletes a session by session ID.\n\n```go\nfunc (p *PostgresProvider) Exist(sid string) bool\n```\nExist returns true if session with given ID exists.\n\n```go\nfunc (p *PostgresProvider) GC()\n```\nGC calls GC to clean expired sessions.\n\n```go\nfunc (p *PostgresProvider) Init(maxlifetime int64, connStr string) (err error)\n```\nInit initializes postgres session provider. connStr: user=a password=b host=localhost port=5432 dbname=c sslmode=disable\n\n```go\nfunc (p *PostgresProvider) Read(sid string) (session.RawStore, error)\n```\nRead returns raw session store by session ID.\n\n```go\nfunc (p *PostgresProvider) Regenerate(oldsid, sid string) (_ session.RawStore, err error)\n```\nRegenerate regenerates a session store from old session ID to new one.\n\n```go\ntype PostgresStore struct {\n\t// contains filtered or unexported fields\n}\n```\nPostgresStore represents a postgres session store implementation.\n\n```go\nfunc NewPostgresStore(c *sql.DB, sid string, kv map[interface{}]interface{}) *PostgresStore\n```\nNewPostgresStore creates and returns a postgres session store.\n\n```go\nfunc (s *PostgresStore) Delete(key interface{}) error\n```\nDelete delete a key from session.\n\n```go\nfunc (s *PostgresStore) Flush() error\n```\nFlush deletes all session data.\n\n```go\nfunc (s *PostgresStore) Get(key interface{}) interface{}\n```\nGet gets value by given key in session.\n\n```go\nfunc (s *PostgresStore) ID() string\n```\nID returns current session ID.\n\n```go\nfunc (s *PostgresStore) Release() error\n```\nsave postgres session values to database. must call this method to save values to database.\n\n```go\nfunc (s *PostgresStore) Set(key, value interface{}) error\n```\nSet sets value to given key in session.\n\n","path":"github.com/go-macaron/session/postgres","name":"session","synopsis":"","isRedistributable":true}
