You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: volumes.go
    path of file: ./repos/moby/vendor/github.com/moby/swarmkit/v2/manager/state/store
    
    the code of the file until where you have to start completion: package store

import (
	"strings"

	memdb "github.com/hashicorp/go-memdb"
	"github.com/moby/swarmkit/v2/api"
)

const tableVolume = "volume"

func init() {
	register(ObjectStoreConfig{
		Table: &memdb.TableSchema{
			Name: tableVol
    
func FindVolumes(tx ReadTx, by By) ([]*api.Volume, error) {
	checkType := func(by By) error {
		switch by.(type) {
		case byName, byNamePrefix, byIDPrefix, byVolumeGroup, byCustom, byCustomPrefix, byDriver:
			return nil
		default:
			return ErrInvalidFindBy
		}
	}

	volumeList := []*api.Volume{}
	appendResult := func(o api.StoreObject) {
		volumeList = append(volumeList, o.(*api.Volume))
	}

	err := tx.find(tableVolume, by, checkType, appendResult)
	return volumeList, err
}