data

package
v0.0.0-...-34cccb3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *sql.DB

Functions

func DBConn

func DBConn()

func GetDB

func GetDB() *sql.DB

Types

type Session

type Session struct {
	Uuid       string
	Email      string
	UserId     string
	Created_at time.Time
}

func (*Session) Check

func (session *Session) Check() (valid bool, err error)

Check checks the session validity.

No parameters. Returns a boolean and an error.

func (*Session) DeleteSession

func (session *Session) DeleteSession()

func (*Session) GetSessionById

func (sess *Session) GetSessionById() (session Session, err error)

CreateSession creates a new session for the user.

It takes no parameters and returns a Session and an error.

type Thread

type Thread struct {
	Uuid      string
	UserId    string
	Title     string
	CreatedAt time.Time
}

func (*Thread) CreateThread

func (thread *Thread) CreateThread() (err error)

type Threads

type Threads struct {
	Uuid      string
	User      User
	Title     string
	CreatedAt time.Time
}

func GetThreadById

func GetThreadById(id string) (thread Threads, err error)

func GetThreads

func GetThreads() (threads []Threads, err error)

type User

type User struct {
	Uuid       string
	Name       string
	Email      string
	Password   string
	Created_at time.Time
}

func GetUserByEmail

func GetUserByEmail(email string) (user User, err error)

func GetUserById

func GetUserById(id string) (user User, err error)

func (*User) CreateSession

func (user *User) CreateSession() (session Session, err error)

func (*User) CreateUser

func (user *User) CreateUser() (err error)

func (*User) Session

func (user *User) Session() (session Session, err error)

Session returns the session for the user.

It takes no parameters and returns a Session and an error.

Jump to

Keyboard shortcuts

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