models

package
v0.0.0-...-f295edf Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Banner struct {
	Id      *BannerId  `json:"id" xml:"id"`
	Title   string     `json:"title" xml:"title"`
	Key     string     `json:"key" xml:"key"`
	Created *time.Time `json:"created" xml:"created"`
	Updated *time.Time `json:"updated" xml:"updated"`
}

type BannerCreate

type BannerCreate struct {
	Title string `json:"title" xml:"title"`
	Key   string `json:"key" xml:"key"`
}

type BannerId

type BannerId = ModelId

type BannerPaginationQuery

type BannerPaginationQuery struct {
	*PaginationQuery
}

type BannerUpdate

type BannerUpdate struct {
	Title string `json:"title" xml:"title"`
	Key   string `json:"key" xml:"key"`
}

type Category

type Category struct {
	Id      *CategoryId `json:"id" xml:"id"`
	Name    string      `json:"name" xml:"name"`
	Created *time.Time  `json:"created" xml:"created"`
	Updated *time.Time  `json:"updated" xml:"updated"`
}

type CategoryCreate

type CategoryCreate struct {
	Name string `json:"name" xml:"name"`
}

type CategoryId

type CategoryId = ModelId

type CategoryPaginationQuery

type CategoryPaginationQuery struct {
	*PaginationQuery
}

type CategoryTree

type CategoryTree struct {
	*Category
	Categories []*CategoryTree `json:"categories" xml:"categories"`
}

type CategoryUpdate

type CategoryUpdate struct {
	Name string `json:"name" xml:"name"`
}

type Channel

type Channel struct {
	Id      *ChannelId `json:"id" xml:"id"`
	Name    string     `json:"name" xml:"name"`
	Created *time.Time `json:"created" xml:"created"`
	Updated *time.Time `json:"updated" xml:"updated"`
}

type ChannelCreate

type ChannelCreate struct {
	Name string `json:"name" xml:"name"`
}

type ChannelId

type ChannelId = ModelId

type ChannelPaginationQuery

type ChannelPaginationQuery struct {
	*PaginationQuery
}

type ChannelUpdate

type ChannelUpdate struct {
	Name string `json:"name" xml:"name"`
}

type Comment

type Comment struct {
	Id      *CommentId `json:"id" xml:"id"`
	Content string     `json:"content" xml:"content"`
	Created *time.Time `json:"created" xml:"created"`
	Updated *time.Time `json:"updated" xml:"updated"`
}

type CommentCreate

type CommentCreate struct {
	Content string `json:"content" xml:"content"`
}

type CommentId

type CommentId = ModelId

type CommentPaginationQuery

type CommentPaginationQuery struct {
	*PaginationQuery
}

type CommentUpdate

type CommentUpdate struct {
	Content string `json:"content" xml:"content"`
}

type File

type File struct {
	Id      *FileId    `json:"id" xml:"id"`
	Name    string     `json:"name" xml:"name"`
	Size    int64      `json:"size" xml:"size"`
	Type    string     `json:"type" xml:"type"`
	Created *time.Time `json:"created" xml:"created"`
	Updated *time.Time `json:"updated" xml:"updated"`
}

type FileId

type FileId = ModelId

type FilePaginationQuery

type FilePaginationQuery struct {
	*PaginationQuery
}

type FileUpdate

type FileUpdate struct {
	Name string `json:"name" xml:"name" validate:"required"`
}

type FileUpload

type FileUpload struct {
	Name string
	Size int64
	Type string
}

type ModelId

type ModelId struct {
	uuid.UUID
}

func NewModelId

func NewModelId() *ModelId

func ParseModelId

func ParseModelId(value string) (*ModelId, errors.Error)

type Object

type Object interface {
	ObjectId() *ObjectId
	ObjectType() ObjectType
}

type ObjectId

type ObjectId = ModelId

type ObjectType

type ObjectType string

type PaginationQuery

type PaginationQuery struct {
	Limit int `query:"limit" validate:"gte=1,lte=100"`
	Start int `query:"start" validate:"gte=0"`
	Page  int `query:"page" validate:"gte=1"`
}

func (*PaginationQuery) Offset

func (q *PaginationQuery) Offset() int

type PaginationResult

type PaginationResult struct {
	Total int         `json:"total" xml:"total"`
	Data  interface{} `json:"data" xml:"data"`
}

type Poll

type Poll struct {
	Id      *PollId    `json:"id" xml:"id"`
	Title   string     `json:"title" xml:"title"`
	Created *time.Time `json:"created" xml:"created"`
	Updated *time.Time `json:"updated" xml:"updated"`
}

type PollCreate

type PollCreate struct {
	Title string `json:"title" xml:"title"`
}

type PollId

type PollId = ModelId

type PollPaginationQuery

type PollPaginationQuery struct {
	*PaginationQuery
}

type PollUpdate

type PollUpdate struct {
	Title string `json:"title" xml:"title"`
}

type Post

type Post struct {
	Id          *PostId           `json:"id" xml:"id"`
	Author      interface{}       `json:"author" xml:"author"`
	Title       string            `json:"title" xml:"title"`
	Description string            `json:"description" xml:"description"`
	Content     string            `json:"content" xml:"content"`
	Status      enums.PostStatus  `json:"status" xml:"status"`
	Privacy     enums.PostPrivacy `json:"privacy" xml:"privacy"`
	Picture     *File             `json:"picture" xml:"picture"`
	Video       *File             `json:"video" xml:"video"`
	Views       int               `json:"views" xml:"views"`
	Published   *time.Time        `json:"published" xml:"published"`
	Categories  *PaginationResult `json:"categories" xml:"categories"`
	Tags        *PaginationResult `json:"tags" xml:"tags"`
	Created     *time.Time        `json:"created" xml:"created"`
	Updated     *time.Time        `json:"updated" xml:"updated"`
}

type PostCreate

type PostCreate struct {
	Title       string            `json:"title" xml:"title"`
	Description string            `json:"description" xml:"description"`
	Content     string            `json:"content" xml:"content"`
	Status      enums.PostStatus  `json:"status" xml:"status"`
	Privacy     enums.PostPrivacy `json:"privacy" xml:"privacy"`
	Views       int               `json:"views" xml:"views"`
	Published   *time.Time        `json:"published" xml:"published"`
}

type PostId

type PostId = ModelId

type PostPaginationQuery

type PostPaginationQuery struct {
	*PaginationQuery
	Status  enums.PostStatus  `query:"status"`
	Privacy enums.PostPrivacy `query:"privacy"`
	Author  string            `query:"author"`
	Term    string            `query:"term"`
}

type PostUpdate

type PostUpdate struct {
	Title       string            `json:"title" xml:"title" validate:"required"`
	Description string            `json:"description" xml:"description"`
	Content     string            `json:"content" xml:"content" validate:"required"`
	Status      enums.PostStatus  `json:"status" xml:"status" validate:"required"`
	Privacy     enums.PostPrivacy `json:"privacy" xml:"privacy" validate:"required"`
	Views       int               `json:"views" xml:"views"`
	Published   *time.Time        `json:"published" xml:"published"`
}

type Subject

type Subject interface {
	SubjectId() *SubjectId
	SubjectType() SubjectType
}

type SubjectId

type SubjectId = ModelId

type SubjectType

type SubjectType string
const (
	SystemSubjectType SubjectType = "system"
)
const (
	UserSubjectType SubjectType = "user"
)

type SystemUser

type SystemUser struct {
	Id *SubjectId `json:"id" xml:"id"`
}

func NewSystemUser

func NewSystemUser() *SystemUser

func (*SystemUser) SubjectId

func (c *SystemUser) SubjectId() *SubjectId

func (*SystemUser) SubjectType

func (*SystemUser) SubjectType() SubjectType

type Tag

type Tag struct {
	Id      *TagId     `json:"id" xml:"id"`
	Name    string     `json:"name" xml:"name"`
	Created *time.Time `json:"created" xml:"created"`
	Updated *time.Time `json:"updated" xml:"updated"`
}

type TagCreate

type TagCreate struct {
	Name string `json:"name" xml:"name"`
}

type TagId

type TagId = ModelId

type TagPaginationQuery

type TagPaginationQuery struct {
	*PaginationQuery
}

type TagUpdate

type TagUpdate struct {
	Name string `json:"name" xml:"name"`
}

type User

type User struct {
	Id        *UserId    `json:"id" xml:"id"`
	FirstName string     `json:"firstName" xml:"firstName"`
	LastName  string     `json:"lastName" xml:"lastName"`
	Email     string     `json:"email" xml:"email"`
	Picture   *File      `json:"picture" xml:"picture"`
	Verified  bool       `json:"verified" xml:"verified"`
	Created   *time.Time `json:"created" xml:"created"`
	Updated   *time.Time `json:"updated" xml:"updated"`
}

func (*User) SubjectId

func (c *User) SubjectId() *ModelId

func (*User) SubjectType

func (*User) SubjectType() SubjectType

type UserChangeIdentity

type UserChangeIdentity struct {
	Email string `json:"email" xml:"email" validate:"required,email"`
}

type UserChangePassword

type UserChangePassword struct {
	OldPassword string `json:"oldPassword" xml:"oldPassword" validate:"required"`
	NewPassword string `json:"newPassword" xml:"newPassword" validate:"required"`
}

type UserCreate

type UserCreate struct {
	FirstName string `json:"firstName" xml:"firstName" validate:"required"`
	LastName  string `json:"lastName" xml:"lastName" validate:"required"`
	Email     string `json:"email" xml:"email" validate:"required,email"`
	Password  string `json:"password" xml:"password" validate:"required"`
}

type UserId

type UserId = ModelId

type UserPaginationQuery

type UserPaginationQuery struct {
	*PaginationQuery
}

type UserUpdate

type UserUpdate struct {
	FirstName string `json:"firstName" xml:"firstName" validate:"required"`
	LastName  string `json:"lastName" xml:"lastName" validate:"required"`
}

Jump to

Keyboard shortcuts

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