models

package
v0.0.0-...-6d4137d Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRecord

type EventRecord struct {
	CreatedAt *time.Time `json:"createdAt" bson:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt" bson:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt" bson:"deletedAt"`
}

type Task

type Task struct {
	ID          primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Title       string             `json:"title" bson:"title"`
	EventRecord *EventRecord       `json:"eventRecord" bson:"eventRecord"`
}

type TaskRepository

type TaskRepository interface {
	FindAll() ([]Task, error)
	FindById(id string) (*Task, error)
	Add(task Task) error
	Update(id string, task Task) error
	Remove(id string) error
}

type User

type User struct {
	ID          primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Email       string             `json:"email" bson:"email"`
	Password    string             `json:"password" bson:"password"`
	EventRecord *EventRecord       `json:"eventRecord" bson:"eventRecord"`
}

type UserPresenter

type UserPresenter struct {
	ID    primitive.ObjectID
	Email string
}

type UserRepository

type UserRepository interface {
	FindAll() ([]User, error)
	FindById(id string) (*User, error)
	Add(user User) error
	Update(id string, user User) error
	Remove(id string) error
	FindByEmail(email string) (User, error)
	VerifyPassword(user *User, password string) (bool, error)
}

Jump to

Keyboard shortcuts

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