models

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTagModel

type AddTagModel struct {
	Ib    uint
	Tag   uint
	Image uint
}

AddTagModel holds the data from the request

func (*AddTagModel) IsValid

func (a *AddTagModel) IsValid() bool

IsValid will check struct validity

func (*AddTagModel) Post

func (a *AddTagModel) Post() (err error)

Post will add the reply to the database with a transaction

func (*AddTagModel) Status

func (a *AddTagModel) Status() (err error)

Status will return info about the thread

func (*AddTagModel) ValidateInput

func (a *AddTagModel) ValidateInput() (err error)

ValidateInput will make sure all the parameters are valid

type EmailModel

type EmailModel struct {
	UID          uint
	Name         string
	Email        string
	CurrentEmail string
}

EmailModel contains new email

func (*EmailModel) IsValid

func (m *EmailModel) IsValid() bool

IsValid will check struct validity

func (*EmailModel) Update

func (m *EmailModel) Update() (err error)

Update will update the email model

func (*EmailModel) Validate

func (m *EmailModel) Validate() (err error)

Validate will check the provided email

type FavoritesModel

type FavoritesModel struct {
	UID   uint
	Image uint
}

FavoritesModel holds the request input

func (*FavoritesModel) IsValid

func (m *FavoritesModel) IsValid() bool

IsValid will check struct validity

func (*FavoritesModel) Post

func (m *FavoritesModel) Post() (err error)

Post will add the fav to the database

func (*FavoritesModel) Status

func (m *FavoritesModel) Status() (err error)

Status will return info

func (*FavoritesModel) ValidateInput

func (m *FavoritesModel) ValidateInput() (err error)

ValidateInput will make sure all the parameters are valid

type NewTagModel

type NewTagModel struct {
	Ib      uint
	Tag     string
	TagType uint
}

NewTagModel holds the request input

func (*NewTagModel) IsValid

func (m *NewTagModel) IsValid() bool

IsValid will check struct validity

func (*NewTagModel) Post

func (m *NewTagModel) Post() (err error)

Post will add the reply to the database with a transaction

func (*NewTagModel) Status

func (m *NewTagModel) Status() (err error)

Status will return info about the thread

func (*NewTagModel) ValidateInput

func (m *NewTagModel) ValidateInput() (err error)

ValidateInput will make sure all the parameters are valid

type PasswordModel

type PasswordModel struct {
	UID       uint
	Name      string
	OldPw     string
	NewPw     string
	NewHashed []byte
}

PasswordModel contains information for initial account creation

func (*PasswordModel) IsValid

func (m *PasswordModel) IsValid() bool

IsValid will check struct validity

func (*PasswordModel) Update

func (m *PasswordModel) Update() (err error)

Update will update the password model

func (*PasswordModel) Validate

func (m *PasswordModel) Validate() (err error)

Validate will check the provided password

type RegisterModel

type RegisterModel struct {
	UID      uint
	Name     string
	Email    string
	Password string
	Hashed   []byte
}

RegisterModel contains information for initial account creation

func (*RegisterModel) IsValid

func (r *RegisterModel) IsValid() bool

IsValid will check struct validity

func (*RegisterModel) Register

func (r *RegisterModel) Register() (err error)

Register will create a new user

func (*RegisterModel) Validate

func (r *RegisterModel) Validate() (err error)

Validate will check the provided name length and email

type ReplyModel

type ReplyModel struct {
	UID         uint
	Ib          uint
	Thread      uint
	IP          string
	Comment     string
	Filename    string
	Thumbnail   string
	MD5         string
	SHA         string
	OrigWidth   int
	OrigHeight  int
	ThumbWidth  int
	ThumbHeight int
	Image       bool
}

ReplyModel holds the request input

func (*ReplyModel) IsValid

func (m *ReplyModel) IsValid() bool

IsValid will check struct validity

func (*ReplyModel) Post

func (m *ReplyModel) Post() (err error)

Post will add the reply to the database with a transaction

func (*ReplyModel) Status

func (m *ReplyModel) Status() (err error)

Status will return info about the thread

func (*ReplyModel) ValidateInput

func (m *ReplyModel) ValidateInput() (err error)

ValidateInput will make sure all the parameters are valid

type ThreadModel

type ThreadModel struct {
	UID         uint
	Ib          uint
	IP          string
	Title       string
	Comment     string
	Filename    string
	Thumbnail   string
	MD5         string
	SHA         string
	OrigWidth   int
	OrigHeight  int
	ThumbWidth  int
	ThumbHeight int
}

ThreadModel holds the request input

func (*ThreadModel) IsValid

func (m *ThreadModel) IsValid() bool

IsValid will check struct validity

func (*ThreadModel) Post

func (m *ThreadModel) Post() (err error)

Post will add the thread to the database with a transaction

func (*ThreadModel) ValidateInput

func (m *ThreadModel) ValidateInput() (err error)

ValidateInput will make sure all the parameters are valid

Jump to

Keyboard shortcuts

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