code: func (c *Client) SearchLocks(filter map[string]string, limit int, localOnly bool, cached bool) ([]Lock, error) {
  	if localOnly {
  		return c.searchLocalLocks(filter, limit)
  	} else if cached {
  		if len(filter) > 0 || limit != 0 {
  			return []Lock{}, errors.New("can't search cached locks when filter or limit is set")
  		}
  
  		locks := []Lock{}
  		err := c.readLocksFromCacheFile("remote", func(decoder *json.Decoder) error {
  			return decoder.Decode(&locks)
  		})
  		return locks, err
  	} else {
  		locks, err := c.searchRemoteLocks(filter, limit)
  		if err != nil {
  			return locks, err
  		}
  
  		if len(filter) == 0 && limit == 0 {
  			err = c.writeLocksToCacheFile("remote", func(writer io.Writer) error {
  				return c.EncodeLocks(locks, writer)
  			})
  		}
  
  		return locks, err
  	}
  }
docs: // SearchLocks returns a channel of locks which match the given name/value filter
  // If limit > 0 then search stops at that number of locks
  // If localOnly = true, don't query the server & report only own local locks