auth

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	UserID    string             `json:"user_id"` // unique identifier for this table
	Provider  types.AuthProvider `json:"provider"`
	Token     string             `json:"token"` // ex HashedPassword, etc
	Status    types.Status       `json:"status"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt time.Time          `json:"updated_at"`
}

func FromEnt

func FromEnt(e *ent.Auth) *Auth

FromEnt converts an ent Auth to a domain Auth

func FromEntList

func FromEntList(auths []*ent.Auth) []*Auth

FromEntList converts a list of ent Auths to domain Auths

func NewAuth

func NewAuth(userID string, provider types.AuthProvider, token string) *Auth

type Claims

type Claims struct {
	UserID   string
	TenantID string
	Email    string
}

type Repository

type Repository interface {
	CreateAuth(ctx context.Context, auth *Auth) error
	GetAuthByUserID(ctx context.Context, userID string) (*Auth, error)
	UpdateAuth(ctx context.Context, auth *Auth) error
	DeleteAuth(ctx context.Context, userID string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL