models

package
v0.0.0-...-5b75e16 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryModel

type CategoryModel struct {
	ModelLifecycles `json:"-"`
	ID              string `db:"id" json:"id"`
	Name            string `db:"name" json:"name"`
}

CategoryModel represents the category data stored in the database.

func (*CategoryModel) AfterCreate

func (m *CategoryModel) AfterCreate() error

func (*CategoryModel) AfterDelete

func (m *CategoryModel) AfterDelete() error

func (*CategoryModel) AfterUpdate

func (m *CategoryModel) AfterUpdate() error

func (*CategoryModel) BeforeCreate

func (m *CategoryModel) BeforeCreate() error

func (*CategoryModel) BeforeDelete

func (m *CategoryModel) BeforeDelete() error

func (*CategoryModel) BeforeUpdate

func (m *CategoryModel) BeforeUpdate() error

type EventAttendeeModel

type EventAttendeeModel struct {
	ModelLifecycles `json:"-"`
	EventId         string    `db:"event_id" json:"event_id"`
	AttendeeId      string    `db:"attendee_id" json:"attendee_id"`
	CreatedAt       time.Time `db:"created_at" json:"created_at"`
}

EventAttendeeModel represents the event_attendee data stored in the database.

func (*EventAttendeeModel) AfterCreate

func (m *EventAttendeeModel) AfterCreate() error

func (*EventAttendeeModel) AfterDelete

func (m *EventAttendeeModel) AfterDelete() error

func (*EventAttendeeModel) AfterUpdate

func (m *EventAttendeeModel) AfterUpdate() error

func (*EventAttendeeModel) BeforeCreate

func (m *EventAttendeeModel) BeforeCreate() error

func (*EventAttendeeModel) BeforeDelete

func (m *EventAttendeeModel) BeforeDelete() error

func (*EventAttendeeModel) BeforeUpdate

func (m *EventAttendeeModel) BeforeUpdate() error

type EventCategoryModel

type EventCategoryModel struct {
	ModelLifecycles `json:"-"`
	EventId         string `db:"event_id" json:"event_id"`
	CategoryId      string `db:"category_id" json:"category_id"`
}

EventCategoryModel represents the event_category data stored in the database.

func (*EventCategoryModel) AfterCreate

func (m *EventCategoryModel) AfterCreate() error

func (*EventCategoryModel) AfterDelete

func (m *EventCategoryModel) AfterDelete() error

func (*EventCategoryModel) AfterUpdate

func (m *EventCategoryModel) AfterUpdate() error

func (*EventCategoryModel) BeforeCreate

func (m *EventCategoryModel) BeforeCreate() error

func (*EventCategoryModel) BeforeDelete

func (m *EventCategoryModel) BeforeDelete() error

func (*EventCategoryModel) BeforeUpdate

func (m *EventCategoryModel) BeforeUpdate() error

type EventFollowerModel

type EventFollowerModel struct {
	ModelLifecycles `json:"-"`
	EventId         string `db:"event_id" json:"event_id"`
	FollowerId      string `db:"follower_id" json:"follower_id"`
}

EventFollowerModel represents the event_follower data stored in the database.

func (*EventFollowerModel) AfterCreate

func (m *EventFollowerModel) AfterCreate() error

func (*EventFollowerModel) AfterDelete

func (m *EventFollowerModel) AfterDelete() error

func (*EventFollowerModel) AfterUpdate

func (m *EventFollowerModel) AfterUpdate() error

func (*EventFollowerModel) BeforeCreate

func (m *EventFollowerModel) BeforeCreate() error

func (*EventFollowerModel) BeforeDelete

func (m *EventFollowerModel) BeforeDelete() error

func (*EventFollowerModel) BeforeUpdate

func (m *EventFollowerModel) BeforeUpdate() error

type EventLikeModel

type EventLikeModel struct {
	ModelLifecycles `json:"-"`
	EventId         string `db:"event_id" json:"event_id"`
	UserId          string `db:"user_id" json:"user_id"`
}

EventLikeModel represents the event_like data stored in the database.

func (*EventLikeModel) AfterCreate

func (m *EventLikeModel) AfterCreate() error

func (*EventLikeModel) AfterDelete

func (m *EventLikeModel) AfterDelete() error

func (*EventLikeModel) AfterUpdate

func (m *EventLikeModel) AfterUpdate() error

func (*EventLikeModel) BeforeCreate

func (m *EventLikeModel) BeforeCreate() error

func (*EventLikeModel) BeforeDelete

func (m *EventLikeModel) BeforeDelete() error

func (*EventLikeModel) BeforeUpdate

func (m *EventLikeModel) BeforeUpdate() error

type EventModel

type EventModel struct {
	Model
	Name        string          `db:"name" json:"name"`
	OrganizerId string          `db:"organizer_id" json:"organizer_id"`
	Description sql.NullString  `db:"description" json:"description"`
	StartDate   time.Time       `db:"start_date" json:"start_date"`
	EndDate     time.Time       `db:"end_date" json:"end_date"`
	IsPaid      bool            `db:"is_paid" json:"is_paid"`
	EventType   types.EventType `db:"event_type" json:"event_type"`
	Country     sql.NullString  `db:"country" json:"country"`
	City        sql.NullString  `db:"city" json:"city"`
	Slug        string          `db:"slug" json:"slug"`
	Likes       int64           `db:"likes" json:"likes"`
	Follows     int64           `db:"follows" json:"follows"`
	Attendees   int64           `db:"attendees" json:"attendees"`
}

EventModel represents the event data stored in the database.

func (*EventModel) BeforeCreate

func (m *EventModel) BeforeCreate() error

BeforeCreate overrides model lifecycle hook

func (*EventModel) BeforeUpdate

func (m *EventModel) BeforeUpdate() error

BeforeUpdate overrides model lifecycle hook, updating the updated_at time.

type EventTagModel

type EventTagModel struct {
	ModelLifecycles `json:"-"`
	EventId         string `db:"event_id" json:"event_id"`
	TagId           string `db:"tag_id" json:"tag_id"`
}

EventTagModel represents the event_tag data stored in the database.

func (*EventTagModel) AfterCreate

func (m *EventTagModel) AfterCreate() error

func (*EventTagModel) AfterDelete

func (m *EventTagModel) AfterDelete() error

func (*EventTagModel) AfterUpdate

func (m *EventTagModel) AfterUpdate() error

func (*EventTagModel) BeforeCreate

func (m *EventTagModel) BeforeCreate() error

func (*EventTagModel) BeforeDelete

func (m *EventTagModel) BeforeDelete() error

func (*EventTagModel) BeforeUpdate

func (m *EventTagModel) BeforeUpdate() error

type Model

type Model struct {
	ModelLifecycles `json:"-"`
	ID              string    `db:"id" json:"id"`
	CreatedAt       time.Time `db:"created_at" json:"created_at"`
	UpdatedAt       time.Time `db:"updated_at" json:"updated_at"`
}

Model provides default fields and lifecycle functions to models.

func (*Model) AfterCreate

func (m *Model) AfterCreate() error

func (*Model) AfterDelete

func (m *Model) AfterDelete() error

func (*Model) AfterUpdate

func (m *Model) AfterUpdate() error

func (*Model) BeforeCreate

func (m *Model) BeforeCreate() error

func (*Model) BeforeDelete

func (m *Model) BeforeDelete() error

func (*Model) BeforeUpdate

func (m *Model) BeforeUpdate() error

type ModelLifecycles

type ModelLifecycles interface {
	BeforeCreate() error
	AfterCreate() error
	BeforeUpdate() error
	AfterUpdate() error
	BeforeDelete() error
	AfterDelete() error
}

ModelLifecycles should be invoked from the repository before and after create, update and deletion of a model which implements the interface.

type ReviewModel

type ReviewModel struct {
	Model
	Title    string `db:"title" json:"title"`
	EventId  string `db:"event_id" json:"event_id"`
	AuthorId string `db:"author_id" json:"author_id"`
	Body     string `db:"body" json:"body"`
}

ReviewModel represents the review data stored in the database.

func (*ReviewModel) BeforeUpdate

func (m *ReviewModel) BeforeUpdate() error

BeforeUpdate overrides model lifecycle hook, updating the updated_at time.

type TagModel

type TagModel struct {
	ModelLifecycles `json:"-"`
	ID              string `db:"id" json:"id"`
	Name            string `db:"name" json:"name"`
}

TagModel represents the tag data stored in the database.

func (*TagModel) AfterCreate

func (m *TagModel) AfterCreate() error

func (*TagModel) AfterDelete

func (m *TagModel) AfterDelete() error

func (*TagModel) AfterUpdate

func (m *TagModel) AfterUpdate() error

func (*TagModel) BeforeCreate

func (m *TagModel) BeforeCreate() error

func (*TagModel) BeforeDelete

func (m *TagModel) BeforeDelete() error

func (*TagModel) BeforeUpdate

func (m *TagModel) BeforeUpdate() error

type UserModel

type UserModel struct {
	Model
	Username  string         `db:"username" json:"username"`
	Email     string         `db:"email" json:"email"`
	GoogleId  sql.NullString `db:"google_id" json:"-"`
	AvatarUrl sql.NullString `db:"avatar_url"`
	Password  string         `db:"password" json:"-"`
	FirstName sql.NullString `db:"first_name" json:"first_name"`
	LastName  sql.NullString `db:"last_name" json:"last_name"`
	BirthDate sql.NullTime   `db:"birth_date" json:"birth_date"`
	Role      types.Role     `db:"role" json:"role"`
	Verified  bool           `db:"verified" json:"verified"`
	About     sql.NullString `db:"about" json:"about"`
}

UserModel represents the user data stored in the database.

func (*UserModel) BeforeCreate

func (m *UserModel) BeforeCreate() error

BeforeCreate overrides model lifecycle hook, hashes the users password before proceeding.

func (*UserModel) BeforeUpdated

func (m *UserModel) BeforeUpdated() error

BeforeUpdated overrides model lifecycle hook, updating the updated_at time.

func (*UserModel) UpdateFrom

func (m *UserModel) UpdateFrom(payload dtos.CreateOrUpdateUser)

Jump to

Keyboard shortcuts

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