entities

package
v0.0.0-...-71fa18b Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogPost

type BlogPost struct {
	ID          int64     `db:"id" json:"id"`
	Title       string    `db:"title" json:"title"`
	Content     string    `db:"content" json:"content"`
	UserID      int64     `db:"userId" json:"userId"`
	Published   time.Time `db:"published" json:"published"`
	Updated     time.Time `db:"updated" json:"updated"`
	CategoryIDs []int64   `json:"categoryIds"`
}

type BlogPostResponse

type BlogPostResponse struct {
	ID         int64               `db:"id" json:"id"`
	Title      string              `db:"title" json:"title"`
	Content    string              `db:"content" json:"content"`
	UserID     int64               `db:"userId" json:"userId"`
	Published  time.Time           `db:"published" json:"published"`
	Updated    time.Time           `db:"updated" json:"updated"`
	User       UserWithoutPassword `db:"user" json:"user"`
	Categories []Category          `db:"categories" json:"categories"`
}

type Category

type Category struct {
	ID   int64  `db:"categories.id" json:"id,omitempty"`
	Name string `db:"categories.name" json:"name,omitempty"`
}

type PostCategory

type PostCategory struct {
	PostID     int64 `db:"postId" json:"postId,omitempty"`
	CategoryID int64 `db:"categoryId" json:"categoryId,omitempty"`
}

type User

type User struct {
	ID          int64  `db:"id" json:"id,omitempty"`
	DisplayName string `db:"displayName" json:"displayName,omitempty"`
	Email       string `db:"email" json:"email,omitempty"`
	Password    string `db:"password" json:"password,omitempty"`
	Image       string `db:"image" json:"image,omitempty"`
}

User presents a user entity.

type UserWithoutPassword

type UserWithoutPassword struct {
	ID          int    `db:"id" json:"id"`
	DisplayName string `db:"displayName" json:"displayName"`
	Email       string `db:"email" json:"email"`
	Image       string `db:"image" json:"image"`
}

User presents a user entity without password.

Jump to

Keyboard shortcuts

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