model

package
v0.0.0-...-38c89c5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTinu

func CreateTinu(tinu Tinu) error

func CreateUser

func CreateUser(user User) error

func DeleteTinu

func DeleteTinu(id string) error

func DeleteUser

func DeleteUser(id string) error

func Setup

func Setup()

func UpdateTinu

func UpdateTinu(tinu Tinu) error

func UpdateUser

func UpdateUser(user User) error

Types

type Tinu

type Tinu struct {
	ID        string `gorm:"primaryKey"        json:"id"`
	URL       string `gorm:"not null"          json:"url"`
	Clicked   uint64 `json:"clicked"`
	UserID    string `gorm:"foreignKey:UserID" json:"user_id"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

func GetAllTinus

func GetAllTinus() ([]Tinu, error)

func GetOneTinu

func GetOneTinu(id string) (Tinu, error)

type User

type User struct {
	ID       string `gorm:"primaryKey"            json:"id"`
	Email    string `gorm:"not null;unique_index" json:"email"`
	PassWord string `gorm:"not null"              json:"password"`
	Tinus    []Tinu `json:"tinus"`
}

func GetAllUsers

func GetAllUsers() ([]User, error)

func GetOneUser

func GetOneUser(id string) (User, error)

Jump to

Keyboard shortcuts

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