models

package
v0.0.0-...-c3f22ab Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ID        int64 `gorm:"PRIMARY_KEY"`
	TopicID   int64
	Topic     Topic `gorm:"foreignKey:TopicID"`
	CreatedAt time.Time
	Content   string
}

func (*Message) Delete

func (m *Message) Delete() error

Delete delete a record from the "topic" table

func (*Message) Insert

func (m *Message) Insert() error

Insert inserts a record to the "topic" table

func (*Message) SelectByID

func (m *Message) SelectByID() error

SelectByID returns a record from the "email" table using id

type Subscriber

type Subscriber struct {
	ID             int64
	SubscriptionID int64
	Subscription   Subscription `gorm:"foreignKey:SubscriptionID"`
	UserID         int64
	UserSub        User `gorm:"foreignKey:UserID"`
	IsSubscribed   bool `gorm:"default:True"`
}

func (*Subscriber) Delete

func (s *Subscriber) Delete() error

Delete delete a record from the "topic" table

func (*Subscriber) Insert

func (s *Subscriber) Insert() error

Insert inserts a record to the "topic" table

func (*Subscriber) SelectByID

func (s *Subscriber) SelectByID() error

SelectByID returns a record from the "email" table using id

func (*Subscriber) SetSubscribe

func (s *Subscriber) SetSubscribe() error

Delete delete a record from the "topic" table

func (*Subscriber) SetUnsubscribe

func (s *Subscriber) SetUnsubscribe() error

Delete delete a record from the "topic" table

type Subscription

type Subscription struct {
	ID      int64 `gorm:"PRIMARY_KEY"`
	TopicID int64
	Topic   Topic  `gorm:"foreignKey:TopicID"`
	Name    string `gorm:"type:varchar(255)"`
}

func (*Subscription) Delete

func (s *Subscription) Delete() error

Delete delete a record from the "topic" table

func (*Subscription) Insert

func (s *Subscription) Insert() error

Insert inserts a record to the "topic" table

func (*Subscription) SelectByID

func (s *Subscription) SelectByID() error

SelectByID returns a record from the "email" table using id

type Topic

type Topic struct {
	ID   int64  `gorm:"PRIMARY_KEY"`
	Name string `gorm:"type:varchar(255)"`
}

func (*Topic) Delete

func (t *Topic) Delete() error

Delete delete a record from the "topic" table

func (*Topic) Insert

func (t *Topic) Insert() error

Insert inserts a record to the "topic" table

func (*Topic) SelectByID

func (t *Topic) SelectByID() error

SelectByID returns a record from the "email" table using id

type TopicSubs

type TopicSubs struct {
	ID             int64 `gorm:"PRIMARY_KEY"`
	TopicID        int64
	Topic          Topic `gorm:"foreignKey:TopicID"`
	SubscriptionID int64
	Subscription   Subscription `gorm:"foreignKey:SubscriptionID"`
}

type User

type User struct {
	ID        int64  `gorm:"PRIMARY_KEY"`
	FirstName string `gorm:"type:varchar(255)"`
	LastName  string `gorm:"type:varchar(255)"`
	Email     string `gorm:"type:varchar(255)"`
}

func (*User) SelectByID

func (u *User) SelectByID() error

SelectByID returns a record from the "user" table using email(username)

Jump to

Keyboard shortcuts

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