Documentation
¶
Index ¶
Constants ¶
View Source
const (
// min bytes for each session token
MinSessionBytesPerToken = 32
)
Variables ¶
This section is empty.
Functions ¶
func Migrate ¶
this is similar to running from command line goose postgres "host=localhost port=5432 user=xyz dbname=abc password=ppp sslmode=disable" up
Types ¶
type NewSession ¶
type PostgresConfig ¶
type PostgresConfig struct {
Host string
Port string
User string
Password string
Database string
SSLMode string
}
func DefaultPostgresConfig ¶
func DefaultPostgresConfig() PostgresConfig
default setup config from docker compose
func (*PostgresConfig) DSN ¶
func (cfg *PostgresConfig) DSN() string
type SessionStore ¶
type SessionStore struct {
DB *sql.DB
//SessionBytesPerToken sets the length of generated session tokens. If unset or too small, the minimum length (MinSessionBytesPerToken) is used.
SessionBytesPerToken int
}
func (*SessionStore) Create ¶
func (ss *SessionStore) Create(userID int) (*NewSession, error)
func (*SessionStore) Delete ¶
func (ss *SessionStore) Delete(token string) error
Delete the session associated with the provided token
func (*SessionStore) UserLookup ¶
func (ss *SessionStore) UserLookup(token string) (*User, error)
Once a session is created we will need a way to query our SessionStore to determine who the user is with that session.
Click to show internal directories.
Click to hide internal directories.