Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DB *pgxpool.Pool
)
Functions ¶
func SetupLogger ¶
func SetupLogger()
func U20Validator ¶ added in v0.2.0
func U20Validator(fl validator.FieldLevel) bool
U20Validator checks if the string matches a userID which is an xid string with a u prefixed. i.e. starts with 'u' followed by 20 alphanumeric characters (a-v, 0-9)
Types ¶
type Comment ¶
type Comment struct { //Unique ID for this post ID uint64 `json:"id"` //The foreign key back to the tasks TaskID uint32 `json:"taskId"` //Optionally the person can leave a username User *string `json:"user"` //The comment box Content string `json:"comment"` //The time the comment was created CreatedAt time.Time `json:"createdAt"` }
type ControllerError ¶
type ControllerError struct { //Msg is a string field to capture a custom error message Msg string `json:"msg"` //Func is the name of the function the error occured in Func string `json:"func"` //Reason is a longer explication of what happened, could be a message from library Reason string `json:"reason"` //Cause is a pointer to why this error is being raised, e.g, error from sub functions Cause *ControllerError `json:"cause"` }
ControllerError - An error with nested response
func (*ControllerError) Error ¶
func (e *ControllerError) Error() string
type FileManager ¶
func NewFileManager ¶
func NewFileManager() FileManager
type Task ¶
type Task struct { ID uint32 `json:"id"` Status bool `json:"status"` Title string `json:"title"` Body *string `json:"body"` Score int32 `json:"score"` CompletedAt *time.Time `json:"completedAt"` CreatedAt time.Time `json:"createdAt"` DeletedAt time.Time `json:"deletedAt"` Comments []Comment `json:"comments"` Images []string `json:"images"` //paths to get all of the images associated with task }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.