entity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageContentText  MessageContentType = "message.content.text"
	MessageContentEvent MessageContentType = "message.content.event"
	MessageContentImage MessageContentType = "message.content.image"

	MessageReceiverUser       MessageReceiverType = "message.receiver.user"
	MessageReceiverDiscussion MessageReceiverType = "message.receiver.discussion"
)

Functions

This section is empty.

Types

type CreateDiscussionParam

type CreateDiscussionParam struct {
	Code        string      `json:"code" validate:"required,min=4"`
	Name        string      `json:"name" validate:"required,min=4"`
	Description string      `json:"description"`
	Password    *string     `json:"password"`
	CreatorID   interface{} `validate:"required"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type CreateMessage

type CreateMessage struct {
	ContentType  MessageContentType  `json:"content_type"`
	Content      string              `json:"content"`
	ReceiverType MessageReceiverType `json:"receiver_type"`
	ReceiverID   interface{}         `json:"receiver_id"`
	Sender       User                `json:"-"`
	CreatedAt    time.Time           `json:"-"`
}

type CreateUserParam

type CreateUserParam struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	ImageUrl string `json:"image_url"`
}

type Discussion

type Discussion struct {
	ID          interface{} `json:"id"`
	Code        string      `json:"code"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Password    *string     `json:"-"`
	PhotoUrl    *string     `json:"image_url"`
	CreatorID   interface{} `json:"creator_id"`
	Members     []*User     `json:"members"`
	Messages    []*Message  `json:"messages"`
	CreatedAt   time.Time   `json:"created_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
}

type ErrInvalidData

type ErrInvalidData struct {
	Message string
	Err     error
}

func (ErrInvalidData) Error

func (eid ErrInvalidData) Error() string

type ErrNotFound

type ErrNotFound struct {
	Message string
	Err     error
}

func (ErrNotFound) Error

func (ent ErrNotFound) Error() string

type ErrValidation

type ErrValidation struct {
	Message string
	Err     error
}

func (ErrValidation) Error

func (evl ErrValidation) Error() string

type GoogleAuth

type GoogleAuth struct {
	TokenID  string `json:"token_id,omitempty"`
	Name     string `json:"name,omitempty"`
	Email    string `json:"email,omitempty"`
	Imageurl string `json:"image_url,omitempty"`
}

type JWTPayload

type JWTPayload struct {
	TokenPayload
	jwt.StandardClaims
}

type JoinDiscussionParam

type JoinDiscussionParam struct {
	Code     string      `json:"code" validate:"required"`
	Password *string     `json:"password"`
	UserID   interface{} `validate:"required"`
}

type Message

type Message struct {
	ID           interface{}         `json:"id"`
	ContentType  MessageContentType  `json:"content_type"`
	Content      string              `json:"content"`
	ReceiverType MessageReceiverType `json:"receiver_type"`
	ReceiverID   interface{}         `json:"receiver_id"`
	Sender       User                `json:"sender"`
	CreatedAt    time.Time           `json:"created_at"`
}

type MessageContentType

type MessageContentType string

type MessageReceiverType

type MessageReceiverType string

type TokenPayload

type TokenPayload struct {
	ID       interface{} `json:"id"`
	Name     string      `json:"name"`
	Email    string      `json:"email"`
	Imageurl string      `json:"image_url"`
}

type UpdateDiscussionParam

type UpdateDiscussionParam struct {
	Code        string `json:"code,omitempty" validate:"min=4"`
	Name        string `json:"name,omitempty" validate:"min=4"`
	Description string `json:"description,omitempty"`
	UpdatedAt   time.Time
}

type UpdateDiscussionPassword

type UpdateDiscussionPassword struct {
	Password             string `json:"password" validate:"required"`
	PasswordConfirmation string `json:"password_confirmation" validate:"required,eqfield=Password"`
}

type User

type User struct {
	ID          interface{}   `json:"id"`
	Name        string        `json:"name"`
	Email       string        `json:"email"`
	ImageUrl    string        `json:"image_url"`
	Discussions []*Discussion `json:"-"`
}

Jump to

Keyboard shortcuts

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