entities

package
v0.0.0-...-e9ef08e Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidName - error when we have an invalid name
	UserNameReq = errors.New("message empty or invalid")
)

Functions

func DecodeAndValidate

func DecodeAndValidate(r *http.Request, v InputValidation) error

Types

type InputValidation

type InputValidation interface {
	Validate() error
}

InputValidation - an interface for all "input submission" structs used for deserialization. We pass in the request so that we can potentially get the context by the request from our context manager

type JsonResponse

type JsonResponse struct {
	Message string      `json:"message"`
	Body    interface{} `json:"body"`
}

type MessageDetails

type MessageDetails struct {
	IsPalindrome bool `bson:"is_palindrome" json:"is_palindrome"`
	Messages
}

type Messages

type Messages struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
	Message   string             `bson:"message" json:"message"`
	CreatedAt time.Time          `bson:"created_at" json:"created_at"`
	UpdatedAt time.Time          `bson:"updated_at" json:"updated_at"`
}

func (Messages) MessagesCollection

func (Messages) MessagesCollection() string

type MessagesCreateInput

type MessagesCreateInput struct {
	Message string `bson:"message" json:"message"`
}

func (MessagesCreateInput) Validate

func (t MessagesCreateInput) Validate() error

Jump to

Keyboard shortcuts

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