entities

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangePasswordInput

type ChangePasswordInput struct {
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

type Channel

type Channel struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	ImageURL    string    `json:"image_url"`
	CreatedAt   string    `json:"created_at,omitempty"`
	Members     []User    `json:"members,omitempty"`
	Messages    []Message `json:"messages,omitempty"`
}

type CreateChannelInput

type CreateChannelInput struct {
	Name        string `json:"name" validate:"required"`
	Description string `json:"description" validate:"required"`
	ImageURL    string `json:"ImageURL"`
}

type JoinChannelInput

type JoinChannelInput struct {
	ChannelID string `json:"channel_id"`
}

type LoginInput

type LoginInput struct {
	Identity string `json:"identity"`
	Password string `json:"password"`
}

type Membership

type Membership struct {
	ID        int64 `json:"id"`
	UserID    int64 `json:"user_id"`
	ChannelID int   `json:"channel_id"`
	User      User  `json:"-"`
}

type Message

type Message struct {
	ID        int    `json:"id"`
	UserID    int64  `json:"user_id"`
	ChannelID int    `json:"channel_id"`
	Content   string `json:"content"`
	CreatedAt string `json:"created_at"`
	User      User   `json:"user,omitempty"`
}

type SignupInput

type SignupInput struct {
	Name      string `json:"name"`
	UserName  string `json:"username"`
	Email     string `json:"email"`
	Password  string `json:"password"`
	AvatarURL string `json:"avatar_url"`
	CreatedAt string `json:"created_at"`
}

type UpdateUserInput

type UpdateUserInput struct {
	Name     string `json:"name" validate:"required,min=5" error:"name is required"`
	Username string `json:"username" validate:"required,min=5,max=20" error:"username is required"`
	Email    string `json:"email" validate:"required,min=5" error:"email is required"`
}

type User

type User struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	UserName  string `json:"username"`
	Email     string `json:"email"`
	Password  string `json:"-"`
	AvatarURL string `json:"avatar_url"`
	Role      string `json:"role,omitempty"`
	CreatedAt string `json:"created_at"`
}

type UserData

type UserData struct {
	ID       int64  `json:"id"`
	UserName string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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