models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	ID          uint `gorm:"primaryKey" json:"id"`
	Name        string
	Icon        string
	URL         string
	Description string
	Tags        []Tag `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	SectionID   uint

	Owner string `gorm:"index" json:"-"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type LinkRepository

type LinkRepository interface {
	FindByID(owner string, id string) (*Link, *exception.AppError)
	FindByIDWithPreload(owner string, id string) (*Link, *exception.AppError)
	Insert(p *Link) *exception.AppError
	Update(p *Link) *exception.AppError
	Delete(owner string, id string) *exception.AppError
}

type LinkRepositoryDb

type LinkRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewLinkRepository

func NewLinkRepository() LinkRepositoryDb

func (LinkRepositoryDb) Delete

func (d LinkRepositoryDb) Delete(owner string, id string) *exception.AppError

func (LinkRepositoryDb) FindByID

func (d LinkRepositoryDb) FindByID(owner string, id string) (*Link, *exception.AppError)

func (LinkRepositoryDb) FindByIDWithPreload

func (d LinkRepositoryDb) FindByIDWithPreload(owner string, id string) (*Link, *exception.AppError)

func (LinkRepositoryDb) Insert

func (d LinkRepositoryDb) Insert(p *Link) *exception.AppError

func (LinkRepositoryDb) Update

func (d LinkRepositoryDb) Update(p *Link) *exception.AppError

type Page

type Page struct {
	ID   string `gorm:"primaryKey" json:"id"`
	Name string `json:"name"`
	Path string `json:"path" gorm:"unique"`

	Icon      string `json:"icon"`
	Size      string `json:"size"`
	FullWidth bool   `json:"full_width"`

	Sections []Section `json:"sections,omitempty"`

	Owner string `gorm:"index" json:"-"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type PageRepository

type PageRepository interface {
	FindAll(owner string) ([]*Page, *exception.AppError)
	FindAllWithPreload(owner string) ([]*Page, *exception.AppError)
	FindByID(owner string, id string) (*Page, *exception.AppError)
	FindByIDWithPreload(owner string, id string) (*Page, *exception.AppError)
	FindByPathWithPreload(owner string, path string) (*Page, *exception.AppError)
	Insert(p *Page) *exception.AppError
	Update(p *Page) *exception.AppError
	Delete(owner, id string) *exception.AppError
}

type PageRepositoryDb

type PageRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewPageRepository

func NewPageRepository() PageRepositoryDb

func (PageRepositoryDb) Delete

func (d PageRepositoryDb) Delete(owner, id string) *exception.AppError

func (PageRepositoryDb) FindAll

func (d PageRepositoryDb) FindAll(owner string) ([]*Page, *exception.AppError)

func (PageRepositoryDb) FindAllWithPreload

func (d PageRepositoryDb) FindAllWithPreload(owner string) ([]*Page, *exception.AppError)

func (PageRepositoryDb) FindByID

func (d PageRepositoryDb) FindByID(owner string, id string) (*Page, *exception.AppError)

func (PageRepositoryDb) FindByIDWithPreload

func (d PageRepositoryDb) FindByIDWithPreload(owner string, id string) (*Page, *exception.AppError)

func (PageRepositoryDb) FindByPathWithPreload

func (d PageRepositoryDb) FindByPathWithPreload(owner string, path string) (*Page, *exception.AppError)

func (PageRepositoryDb) Insert

func (d PageRepositoryDb) Insert(p *Page) *exception.AppError

func (PageRepositoryDb) Update

func (d PageRepositoryDb) Update(p *Page) *exception.AppError

type RssFeed

type RssFeed struct {
	ID         uint `gorm:"primaryKey" json:"id"`
	URL        string
	ItemsLimit int
	SectionID  uint

	Owner string `gorm:"index" json:"-"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type RssFeedRepository

type RssFeedRepository interface {
	FindByID(owner string, id string) (*RssFeed, *exception.AppError)
	Insert(p *RssFeed) *exception.AppError
	Update(p *RssFeed) *exception.AppError
	Delete(owner string, id string) *exception.AppError
}

type RssFeedRepositoryDb

type RssFeedRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewRssFeedRepository

func NewRssFeedRepository() RssFeedRepositoryDb

func (RssFeedRepositoryDb) Delete

func (d RssFeedRepositoryDb) Delete(owner string, id string) *exception.AppError

func (RssFeedRepositoryDb) FindByID

func (d RssFeedRepositoryDb) FindByID(owner string, id string) (*RssFeed, *exception.AppError)

func (RssFeedRepositoryDb) Insert

func (RssFeedRepositoryDb) Update

type Section

type Section struct {
	ID                  uint `gorm:"primaryKey"`
	Name                string
	Icon                string
	ColumnSize          int
	TitleFontSize       string
	DescriptionFontSize string
	PageID              string
	Order               int
	Owner               string

	CloudTags bool
	Link      bool
	Links     []Link
	Rss       bool
	RssFeed   RssFeed `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type SectionRepository

type SectionRepository interface {
	FindByID(owner string, id string) (*Section, *exception.AppError)
	Insert(p *Section) *exception.AppError
	Update(p *Section) *exception.AppError
	Delete(owner, id string) *exception.AppError
}

type SectionRepositoryDb

type SectionRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewSectionRepository

func NewSectionRepository() SectionRepositoryDb

func (SectionRepositoryDb) Delete

func (d SectionRepositoryDb) Delete(owner, id string) *exception.AppError

func (SectionRepositoryDb) FindByID

func (d SectionRepositoryDb) FindByID(owner string, id string) (*Section, *exception.AppError)

func (SectionRepositoryDb) Insert

func (SectionRepositoryDb) Update

type Setting

type Setting struct {
	gorm.Model
	ID    string `gorm:"primaryKey" json:"id"`
	Value string `json:"value"`
}

type SettingRepository

type SettingRepository interface {
	FindAll() ([]*Setting, *exception.AppError)
	FindByID(id string) (*Setting, *exception.AppError)
	Insert(u *Setting) *exception.AppError
	Update(u *Setting) *exception.AppError
	Delete(id string) *exception.AppError
}

type SettingRepositoryDb

type SettingRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewSettingRepository

func NewSettingRepository() SettingRepositoryDb

func (SettingRepositoryDb) Delete

func (SettingRepositoryDb) FindAll

func (d SettingRepositoryDb) FindAll() ([]*Setting, *exception.AppError)

func (SettingRepositoryDb) FindByID

func (d SettingRepositoryDb) FindByID(id string) (*Setting, *exception.AppError)

func (SettingRepositoryDb) Insert

func (SettingRepositoryDb) Update

type Tag

type Tag struct {
	ID uint `gorm:"primaryKey" json:"id"`

	Name   string
	LinkID uint

	Owner string `gorm:"index" json:"-"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type TagRepository

type TagRepository interface {
	FindByID(owner string, id string) (*Tag, *exception.AppError)
	Insert(p *Tag) *exception.AppError
	Update(p *Tag) *exception.AppError
	Delete(owner string, link string, name string) *exception.AppError
}

type TagRepositoryDb

type TagRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewTagRepository

func NewTagRepository() TagRepositoryDb

func (TagRepositoryDb) Delete

func (d TagRepositoryDb) Delete(owner string, link string, name string) *exception.AppError

func (TagRepositoryDb) FindByID

func (d TagRepositoryDb) FindByID(owner string, id string) (*Tag, *exception.AppError)

func (TagRepositoryDb) Insert

func (d TagRepositoryDb) Insert(p *Tag) *exception.AppError

func (TagRepositoryDb) Update

func (d TagRepositoryDb) Update(p *Tag) *exception.AppError

type User

type User struct {
	ID       string `gorm:"primaryKey" json:"id"`
	Username string `gorm:"index" json:"username"`
	Password string `json:"password,omitempty"`
	Token    string `json:"token,omitempty"`

	AccessToken string `gorm:"-" json:"access_token,omitempty"`

	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type UserRepository

type UserRepository interface {
	FindByUsername(username string) (*User, *exception.AppError)
	FindByID(id string) (*User, *exception.AppError)
	Insert(u *User) *exception.AppError
	Update(u *User) *exception.AppError
}

type UserRepositoryDb

type UserRepositoryDb struct {
	// contains filtered or unexported fields
}

func NewUserRepository

func NewUserRepository() UserRepositoryDb

func (UserRepositoryDb) FindByID

func (d UserRepositoryDb) FindByID(id string) (*User, *exception.AppError)

func (UserRepositoryDb) FindByUsername

func (d UserRepositoryDb) FindByUsername(username string) (*User, *exception.AppError)

func (UserRepositoryDb) Insert

func (d UserRepositoryDb) Insert(u *User) *exception.AppError

func (UserRepositoryDb) Update

func (d UserRepositoryDb) Update(u *User) *exception.AppError

Jump to

Keyboard shortcuts

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