good morning!!!!

Skip to content
Snippets Groups Projects
Commit e61eb254 authored by José Carlos Nieto's avatar José Carlos Nieto
Browse files

Adding method comments.

parent 53460deb
No related branches found
No related tags found
Loading
......@@ -39,22 +39,28 @@ func err(e error) error {
return e
}
// NonExistentCollection represents a collection that does not exist.
type NonExistentCollection struct {
Err error
}
// NonExistentResult represents a result set that was based on a non existent
// collection and therefore does not exist.
type NonExistentResult struct {
Err error
}
// Append returns error.
func (c *NonExistentCollection) Append(interface{}) (interface{}, error) {
return nil, err(c.Err)
}
// Exists returns false.
func (c *NonExistentCollection) Exists() bool {
return false
}
// Find returns a NonExistentResult.
func (c *NonExistentCollection) Find(...interface{}) db.Result {
if c.Err != nil {
return &NonExistentResult{Err: c.Err}
......@@ -62,62 +68,77 @@ func (c *NonExistentCollection) Find(...interface{}) db.Result {
return &NonExistentResult{Err: fmt.Errorf("Collection reported an error: %q", err(c.Err))}
}
// Truncate returns error.
func (c *NonExistentCollection) Truncate() error {
return err(c.Err)
}
// Name returns an empty string.
func (c *NonExistentCollection) Name() string {
return ""
}
// Limit returns a NonExistentResult.
func (r *NonExistentResult) Limit(uint) db.Result {
return r
}
// Skip returns a NonExistentResult.
func (r *NonExistentResult) Skip(uint) db.Result {
return r
}
// Sort returns a NonExistentResult.
func (r *NonExistentResult) Sort(...interface{}) db.Result {
return r
}
// Select returns a NonExistentResult.
func (r *NonExistentResult) Select(...interface{}) db.Result {
return r
}
// Where returns a NonExistentResult.
func (r *NonExistentResult) Where(...interface{}) db.Result {
return r
}
// Group returns a NonExistentResult.
func (r *NonExistentResult) Group(...interface{}) db.Result {
return r
}
// Remove returns error.
func (r *NonExistentResult) Remove() error {
return err(r.Err)
}
// Update returns error.
func (r *NonExistentResult) Update(interface{}) error {
return err(r.Err)
}
// Count returns 0 and error.
func (r *NonExistentResult) Count() (uint64, error) {
return 0, err(r.Err)
}
// Next returns error.
func (r *NonExistentResult) Next(interface{}) error {
return err(r.Err)
}
// One returns error.
func (r *NonExistentResult) One(interface{}) error {
return err(r.Err)
}
// All returns error.
func (r *NonExistentResult) All(interface{}) error {
return err(r.Err)
}
// Close returns error.
func (r *NonExistentResult) Close() error {
return err(r.Err)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment