Documentation ¶
Index ¶
- Variables
- type Avatar
- type Categories
- type Category
- func (c *Category) AddSubscriber(id uuid.UUID)
- func (c *Category) RemoveSubscriber(id uuid.UUID)
- func (c Category) String() string
- func (c *Category) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (c *Category) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (c *Category) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type EmailNotTaken
- type Forum
- type Forums
- type Replies
- type Reply
- type Topic
- type Topics
- type User
- func (u *User) AddSubscription(id uuid.UUID)
- func (u *User) Authorize(tx *pop.Connection) error
- func (u *User) Create(tx *pop.Connection) (*validate.Errors, error)
- func (u User) Image() string
- func (u User) IsAuthor(id uuid.UUID) bool
- func (u *User) RemoveSubscription(id uuid.UUID)
- func (u User) String() string
- func (u User) Subscribed(id uuid.UUID) bool
- func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type UsernameIsLowerCase
- type UsernameNotTaken
- type Users
Constants ¶
This section is empty.
Variables ¶
var DB *pop.Connection
DB is a connection to your database to be used throughout your application.
Functions ¶
This section is empty.
Types ¶
type Categories ¶
type Categories []Category
Categories is not required by pop and may be deleted
func (Categories) Len ¶
func (p Categories) Len() int
func (Categories) Less ¶
func (p Categories) Less(i, j int) bool
func (Categories) String ¶
func (c Categories) String() string
String is not required by pop and may be deleted
func (Categories) Swap ¶
func (p Categories) Swap(i, j int)
type Category ¶
type Category struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Title string `json:"title" db:"title"` Description nulls.String `json:"description" db:"description"` ParentCategory nulls.UUID `json:"parent_category" db:"parent_category"` Subscribers slices.UUID `json:"subscribers" db:"subscribers"` }
func (*Category) AddSubscriber ¶
func (*Category) RemoveSubscriber ¶
func (*Category) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Category) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Category) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type EmailNotTaken ¶
func (*EmailNotTaken) IsValid ¶
func (v *EmailNotTaken) IsValid(errors *validate.Errors)
IsValid performs the validation check for unique emails
type Forum ¶
type Forum struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Title string `json:"title" db:"title"` Description string `json:"description" db:"description"` Logo []byte `json:"logo" db:"logo"` }
func (*Forum) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*Forum) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Forum) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type Reply ¶
type Reply struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` AuthorID uuid.UUID `json:"author_id" db:"author_id"` TopicID uuid.UUID `json:"topic_id" db:"topic_id"` Content string `json:"content" db:"content"` Deleted bool `json:"deleted" db:"deleted"` Author *User `json:"-" db:"-"` Topic *Topic `json:"-" db:"-"` }
type Topic ¶
type Topic struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Title string `json:"title" db:"title"` Content string `json:"content" db:"content"` AuthorID uuid.UUID `json:"author_id" db:"author_id"` CategoryID uuid.UUID `json:"category_id" db:"category_id"` Deleted bool `json:"deleted" db:"deleted"` Subscribers slices.UUID `json:"subscribers" db:"subscribers"` Author *User `json:"-" db:"-"` Category *Category `json:"-" db:"-"` Replies Replies `json:"-" db:"-"` }
func (*Topic) AddSubscriber ¶
func (Topic) LastUpdate ¶
func (*Topic) RemoveSubscriber ¶
type User ¶
type User struct { ID uuid.UUID `json:"id" db:"id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` Username string `json:"username" db:"username"` Email string `json:"email" db:"email"` PasswordHash string `json:"-" db:"password_hash"` Password string `json:"-" db:"-"` PasswordConfirm string `json:"-" db:"-"` FullName string `json:"full_name" db:"full_name" form:"full_name"` Avatar []byte `json:"avatar" db:"avatar"` Admin bool `json:"admin" db:"admin"` Subscriptions slices.UUID `json:"subscriptions" db:"subscriptions"` }
func (*User) AddSubscription ¶
func (*User) Authorize ¶
func (u *User) Authorize(tx *pop.Connection) error
Authorize checks user's password for logging in
func (*User) RemoveSubscription ¶
func (*User) Validate ¶
Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.
func (*User) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*User) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.
type UsernameIsLowerCase ¶
type UsernameIsLowerCase struct { Name string Field string // contains filtered or unexported fields }
func (*UsernameIsLowerCase) IsValid ¶
func (v *UsernameIsLowerCase) IsValid(errors *validate.Errors)
type UsernameNotTaken ¶
func (*UsernameNotTaken) IsValid ¶
func (v *UsernameNotTaken) IsValid(errors *validate.Errors)