entity

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTodoParam

type CreateTodoParam struct {
	Task      string             `json:"task" bson:"task" validate:"required,min=1,max=50"`
	Completed bool               `json:"completed" bson:"completed"`
	UserID    primitive.ObjectID `bson:"userId,omitempty"`
}

type CreateUserParam

type CreateUserParam struct {
	Name     string `json:"name" bson:"name" validate:"required"`
	Email    string `json:"email" bson:"email" validate:"required"`
	ImageUrl string `json:"imageUrl" bson:"imageUrl" validate:"required"`
}

type ErrNotFound added in v1.0.0

type ErrNotFound struct {
	Message string
	Err     error
}

func NewErrNotFound added in v1.0.0

func NewErrNotFound(message string, err error) *ErrNotFound

func (ErrNotFound) Error added in v1.0.0

func (ent ErrNotFound) Error() string

type ErrValidation added in v1.0.0

type ErrValidation struct {
	Message string
	Errors  []map[string]string
	Err     error
}

func NewErrValidation added in v1.0.0

func NewErrValidation(message string, errors []map[string]string, err error) *ErrValidation

func (ErrValidation) Error added in v1.0.0

func (ve 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:"imageUrl,omitempty"`
}

type JWTPayload

type JWTPayload struct {
	TokenPayload
	jwt.StandardClaims
}

type Todo

type Todo struct {
	ID        primitive.ObjectID `json:"id" bson:"_id"`
	Task      string             `json:"task" bson:"task"`
	Completed bool               `json:"completed" bson:"completed"`
	UserID    primitive.ObjectID `json:"userId" bson:"userId,omitempty"`
}

type TokenPayload added in v1.0.0

type TokenPayload struct {
	ID       primitive.ObjectID `json:"id"`
	Name     string             `json:"name"`
	Email    string             `json:"email"`
	Imageurl string             `json:"imageUrl"`
}

type UpdateTodoParam

type UpdateTodoParam struct {
	Task      string `json:"task,omitempty" bson:"task" validate:"min=1,max=50"`
	Completed bool   `json:"completed,omitempty" bson:"completed"`
}

type User

type User struct {
	ID       primitive.ObjectID `json:"id" bson:"_id"`
	Name     string             `json:"name" bson:"name"`
	Email    string             `json:"email" bson:"email"`
	ImageUrl string             `json:"imageUrl" bson:"imageUrl"`
}

Jump to

Keyboard shortcuts

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