Documentation
¶
Index ¶
- Variables
- type DB
- type Links
- func (l *Links) All(ctx context.Context) ([]*foundation.Link, error)
- func (l *Links) AllWithVisitCounts(ctx context.Context) ([]*foundation.Link, error)
- func (l *Links) ByShortLink(ctx context.Context, shortLink string) (*foundation.Link, error)
- func (l *Links) Delete(ctx context.Context, shortLink string) error
- func (l *Links) Insert(ctx context.Context, link *foundation.Link) error
- func (l *Links) Update(ctx context.Context, link *foundation.Link) error
- type Sessions
- func (s *Sessions) ByID(ctx context.Context, sessionID string) (*foundation.Session, error)
- func (s *Sessions) Delete(ctx context.Context, sessionID string) error
- func (s *Sessions) InsertAnonymousSession(ctx context.Context) (*foundation.Session, error)
- func (s *Sessions) InsertUserSession(ctx context.Context, userID int64) (*foundation.Session, error)
- func (s *Sessions) RotateSessionIfNeeded(ctx context.Context, sessionID string) (*foundation.Session, error)
- type Users
- func (u *Users) All(ctx context.Context) ([]*foundation.User, error)
- func (u *Users) ByID(ctx context.Context, id int64) (*foundation.User, error)
- func (u *Users) ByUsername(ctx context.Context, username string) (*foundation.User, error)
- func (u *Users) Delete(ctx context.Context, userID int64) error
- func (u *Users) ExistsByUsername(ctx context.Context, username string) (bool, error)
- func (u *Users) Insert(ctx context.Context, user *foundation.User) error
- func (u *Users) Update(ctx context.Context, user *foundation.User) error
- type Visits
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SessionLength = 32 CSRFTokenLength = 32 SessionDuration = 90 * 24 * time.Hour SessionRotationInterval = 30 * time.Minute )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type Links ¶
type Links struct {
// contains filtered or unexported fields
}
func (*Links) AllWithVisitCounts ¶
func (*Links) ByShortLink ¶
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func (*Sessions) InsertAnonymousSession ¶
InsertAnonymousSession creates a new anonymous session (no user ID)
func (*Sessions) InsertUserSession ¶
func (s *Sessions) InsertUserSession(ctx context.Context, userID int64) (*foundation.Session, error)
InsertUserSession creates a new session for a user
func (*Sessions) RotateSessionIfNeeded ¶
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func (*Users) ByUsername ¶
func (*Users) ExistsByUsername ¶
Click to show internal directories.
Click to hide internal directories.