Documentation ¶
Overview ¶
Package items handles all the todo items
Index ¶
Constants ¶
View Source
const (
// StatusDeleted is the status of the item returned after it's deleted
StatusDeleted = "deleted"
)
Variables ¶
View Source
var ( // ErrCreate is returned if there's an error in creating a new item ErrCreate = errors.New("Sorry, an error occurred while creating") // ErrRead is returned if there's an error reading an item ErrRead = errors.New("Sorry, unable to fetch item") // ErrInvOwnerID is returned if the owner ID is blank or invalid ErrInvOwnerID = errors.New("Sorry, invalid owner ID provided") )
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { // ID is the unique identifier of a single item ID string `json:"id,omitempty" bson:"id,omitempty"` // Title is the title of a single item Title string `json:"title,omitempty" bson:"title,omitempty"` // Description is the description of a single item Description string `json:"description,omitempty" bson:"description,omitempty"` // Status is the current status of the item, it's set only while returning a deleted item Status string `json:"status,omitempty" bson:"status,omitempty"` // OwnerID is the unique identifier of an owner OwnerID string `json:"-" bson:"ownerID,omitempty"` // Blob stores the encrypted byte of Item Blob []byte `json:"-" bson:"blob,omitempty"` // CreatedAt is a UTC timestamp of when the item was created CreatedAt *time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` // ModifiedAt is the UTC timestamp of when the item was last updated ModifiedAt *time.Time `json:"modifiedAt,omitempty" bson:"modifiedAt,omitempty"` }
Item holds a single item
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds all the dependencies of items
func NewService ¶
NewService returns a new instance of Service with all the dependencies initialized
Click to show internal directories.
Click to hide internal directories.