model

package
v0.0.0-...-d172adb Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initdatabase

func Initdatabase() *gorm.DB

Types

type Config

type Config struct {
	AllowOrigins []string
	Port         string
	Debug        bool
	Database     string
	Salt         string
	TLS          bool
	CERTPath     string
	KEYPath      string
}

func (*Config) Load

func (c *Config) Load() error

type Feed

type Feed struct {
	ID    int64
	Title string
	Url   string
	Feed  string
}

func (*Feed) Get

func (f *Feed) Get() error

func (*Feed) New

func (f *Feed) New() error

func (*Feed) Post

func (f *Feed) Post() []Post

func (*Feed) Update

func (f *Feed) Update() error

type JwtCustomClaims

type JwtCustomClaims struct {
	Mail string `json:"mail"`
	jwt.StandardClaims
}

type Post

type Post struct {
	ID          int64 `gorm:"AUTO_INCREMENT"`
	FID         int64
	Title       string
	Content     string
	Url         string
	Description string
	Published   string
}

func (*Post) Delete

func (p *Post) Delete() error

func (*Post) Get

func (p *Post) Get() error

func (*Post) New

func (p *Post) New() error

type Read

type Read struct {
	ID  int64 `gorm:"AUTO_INCREMENT"`
	PID int64
	UID int64
}

type Response

type Response struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

type Star

type Star struct {
	ID  int64 `gorm:"AUTO_INCREMENT"`
	PID int64
	UID int64
}

type User

type User struct {
	ID       int64 `gorm:"AUTO_INCREMENT"`
	Mail     string
	Password string
	// contains filtered or unexported fields
}

func (*User) AddSub

func (u *User) AddSub(sub int64) error

func (*User) DelSub

func (u *User) DelSub(sub int64) error

func (*User) Get

func (u *User) Get() error

func (*User) GetSub

func (u *User) GetSub() error

func (*User) New

func (u *User) New() error

func (*User) Read

func (u *User) Read(pid int64) error

func (*User) ReadPost

func (u *User) ReadPost() ([]int64, error)

func (*User) Save

func (u *User) Save() error

func (*User) Sub

func (u *User) Sub() []subscribe

func (*User) UnRead

func (u *User) UnRead(pid int64) error

func (*User) VerPassword

func (u *User) VerPassword(getPassword string) bool

Jump to

Keyboard shortcuts

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