Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoResult indicates that no documents were found ErrNoResult = errors.New("no document found") // ErrInvalidInput indicates that an input was invalid ErrInvalidInput = errors.New("invalid input") // ErrInvalidKind indicates that a kind was invalid ErrInvalidKind = errors.New("invalid kind") // ErrInvalidObjectID indicates that an object ID was invalid ErrInvalidObjectID = errors.New("invalid resource id") // ErrInternalError indicates that there was an function or backend error ErrInternalError = errors.New("server or network error") )
Functions ¶
func MongoToAPIError ¶
MongoToAPIError converts an MongoDB error to an internal error
Types ¶
type CustomFilter ¶
CustomFilter describes a custom filter
func (*CustomFilter) Filter ¶
func (f *CustomFilter) Filter() bson.D
Filter implements the DocumentFilter interface
type DocumentFilter ¶
DocumentFilter describes the interface for filtering documents
type ObjectID ¶
ObjectID defines an object ID
func ToObjectID ¶
ToObjectID converts a string id to an object ID
type Response ¶
type Response struct { Status string `json:"status"` Message string `json:"message"` StatusCode int `json:"code"` }
Response describes a status response
func NewResponse ¶
NewResponse creates a new status response based on parameters
type Result ¶
type Result struct { Count int64 `json:"total"` Items []interface{} `json:"items"` }
Result describes an result output
type Timestamp ¶
Timestamp outputs the time in a Unix timestamp
func (*Timestamp) MarshalJSON ¶
MarshalJSON implements the JSON marshaler
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the JSON unmarshaler
Click to show internal directories.
Click to hide internal directories.