git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/auth/sessions.go (about)

     1  package auth
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  
     7  	"git.sr.ht/~pingoo/stdx/db"
     8  	"git.sr.ht/~pingoo/stdx/uuid"
     9  )
    10  
    11  type Session struct {
    12  	ID        uuid.UUID
    13  	CreatedAt time.Time
    14  	UpdatedAt time.Time
    15  
    16  	AccountID uuid.UUID
    17  }
    18  
    19  func CreateSession(ctx context.Context, db db.Queryer, accountID uuid.UUID) (token string, err error) {
    20  	panic("TODO")
    21  }
    22  
    23  func GetSessionsForAccount(ctx context.Context, db db.Queryer, accountID uuid.UUID) (sessions []Session, err error) {
    24  	panic("TODO")
    25  }
    26  
    27  func RefreshSession(ctx context.Context, db db.Queryer, oldToken string) (newToken string, err error) {
    28  	panic("TODO")
    29  }
    30  
    31  func DeleteSession(ctx context.Context, db db.Queryer, token string) (err error) {
    32  	panic("TODO")
    33  }