models

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID           string `mapstructure:"id" json:"-" validate:"uuid_rfc4122"`
	InReplyToID  string `mapstructure:"in-reply-to-id" json:"-" validate:"omitempty,uuid_rfc4122"`
	From         string `mapstructure:"from" json:"-" validate:"required,printascii"`
	Newsgroup    string `mapstructure:"newsgroup" json:"-" validate:"required,min=2,max=80,printascii,lowercase"`
	Subject      string `mapstructure:"subject" json:"-" validate:"required,min=2,max=128,printascii"`
	Date         int64  `mapstructure:"date" json:"-" validate:"required,number"`
	Organization string `mapstructure:"organization" json:"-" validate:"printascii"`
	Body         string `mapstructure:"body" json:"-" validate:"required,min=3,max=524288"`

	Replies     []*Article `mapstructure:"-" json:"-" validate:"-"`
	LatestReply int64      `mapstructure:"-" json:"-" validate:"-"`

	Read bool `mapstructure:"-" json:"read" validate:"-"`
}

func NewArticle

func NewArticle() *Article

func (*Article) IsValid

func (article *Article) IsValid() (bool, error)

Jump to

Keyboard shortcuts

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