func (op *localFileOp) verifyStateHelper(name string, entry FileEntry) error {
	currState := entry.GetState()
	for state := range op.states {
		if currState == state {
			return nil
		}
	}
	return &FileStateError{
		Op:    "verifyStateHelper",
		Name:  name,
		State: currState,
		Msg:   fmt.Sprintf("desired states: %v", op.states),
	}
}
verifyStateHelper verifies file is in one of the acceptable states.
package base
import (
	"fmt"
	"os"
	"github.com/uber/makisu/lib/storage/metadata"
)
type lockLevel int
const (
	_lockLevelPeek lockLevel = iota
	_lockLevelRead
	_lockLevelWrite
)
type FileOp interface {
	AcceptState(state FileState) FileOp
	CreateFile(name string, createState FileState, len int64) error
	MoveFileFrom(name string, createState FileState, sourcePath string) error
	MoveFile(name string, goalState FileState) error
	LinkFileTo(name string, targetPath string) error
	DeleteFile(name string) error
	GetFilePath(name string) (string, error)
	GetFileStat(name string) (os.FileInfo, error)
	GetFileReader(name string) (FileReader, error)
	GetFileReadWriter(name string) (FileReadWriter, error)
	GetFileMetadata(name string, md metadata.Metadata) error
	SetFileMetadata(name string, md metadata.Metadata) (bool, error)
	SetFileMetadataAt(name string, md metadata.Metadata, b []byte, offset int64) (bool, error)
	GetOrSetFileMetadata(name string, md metadata.Metadata) error
	DeleteFileMetadata(name string, md metadata.Metadata) error
}
var _ FileOp = (*localFileOp)(nil)
type localFileOp struct {
	s      *localFileStore
	states map[FileState]interface{}  
}
func NewLocalFileOp(s *localFileStore) FileOp {
	return &localFileOp{
		s:      s,
		states: make(map[FileState]interface{}),
	}
}
func (op *localFileOp) AcceptState(state FileState) FileOp {
	op.states[state] = struct{}{}
	return op
}