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 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 ¶
type MessagesCreateInput ¶
type MessagesCreateInput struct {
Message string `bson:"message" json:"message"`
}
func (MessagesCreateInput) Validate ¶
func (t MessagesCreateInput) Validate() error
Click to show internal directories.
Click to hide internal directories.