v1

package
v0.0.0-...-7161ace Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	Slug           string    `json:"slug"`
	Title          string    `json:"title"`
	Description    string    `json:"description"`
	Body           string    `json:"body"`
	TagList        []string  `json:"tagList"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
	Favorited      bool      `json:"favorited"`
	FavoritesCount int       `json:"favoritesCount"`
	Author         Author    `json:"author"`
}

type ArticleRequest

type ArticleRequest struct {
	Article struct {
		Title       string   `json:"title,omitempty"`
		Description string   `json:"description,omitempty"`
		Body        string   `json:"body,omitempty"`
		TagList     []string `json:"tagList,omitempty"`
	} `json:"article"`
}

type ArticleResponse

type ArticleResponse struct {
	Article *Article `json:"article"`
}

type Articles

type Articles struct {
	ArticleCount int       `json:"articleCount"`
	Articles     []Article `json:"articles"`
}

type ArticlesResponse

type ArticlesResponse struct {
	Articles Articles `json:"articles"`
}

type Author

type Author struct {
	Username  string `json:"username"`
	Bio       string `json:"bio"`
	Image     string `json:"image"`
	Following bool   `json:"following"`
}

type Comment

type Comment struct {
	Id        int       `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Body      string    `json:"body"`
	Author    Author    `json:"author"`
}

type LoginRequest

type LoginRequest struct {
	User struct {
		Email    string `form:"email" json:"email" binding:"exists,email"`
		Password string `form:"password" json:"password" binding:"exists,min=8,max=255"`
	} `json:"user"`
}

type LoginResponse

type LoginResponse struct {
	User LoginUser `json:"user"`
}

LoginResponse is the response of login request

type LoginUser

type LoginUser struct {
	Email string `json:"email"`
	Name  string `json:"username"`
	Bio   string `json:"bio"`
	Image string `json:"image"`
	Token string `json:"token"`
}

type Profile

type Profile struct {
	Username  string `json:"username"`
	Bio       string `json:"bio"`
	Image     string `json:"image"`
	Following bool   `json:"following"`
}

type RefreshTokenResponse

type RefreshTokenResponse struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
}

RefreshTokenResponse is the response of refresh token request

type User

type User struct {
	Email    string      `json:"email"`
	Token    string      `json:"token"`
	Username string      `json:"username"`
	Bio      string      `json:"bio"`
	Image    interface{} `json:"image"`
}

type UserBase

type UserBase struct {
	Name  string `json:"username"`
	Email string `json:"email"`
}

type UserRequest

type UserRequest struct {
	User struct {
		Name     string `form:"username" json:"username" binding:"exists,min=4,max=255"`
		Email    string `form:"email" json:"email" binding:"exists,email"`
		Password string `form:"password" json:"password" binding:"exists,min=8,max=255"`
		Bio      string `json:"bio"`
		Image    string `json:"image"`
	} `json:"user"`
}

Jump to

Keyboard shortcuts

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