Skip to content

Commit

Permalink
s/Writeable/Writable/g
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdaniels committed Jan 18, 2021
1 parent 5aa3556 commit cf845be
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion internal/driver/gomobile/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var _ repository.Repository = (*mobileFileRepo)(nil)
var _ repository.ListableRepository = (*mobileFileRepo)(nil)

// TODO add write support (not yet supported on mobile)
// var _ repository.WriteableRepository = (*mobileFileRepo)(nil)
// var _ repository.WritableRepository = (*mobileFileRepo)(nil)

type mobileFileRepo struct {
driver *mobileDriver
Expand Down
8 changes: 4 additions & 4 deletions internal/repository/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const fileSchemePrefix string = "file://"

// declare conformance with repository types
var _ repository.Repository = (*FileRepository)(nil)
var _ repository.WriteableRepository = (*FileRepository)(nil)
var _ repository.WritableRepository = (*FileRepository)(nil)
var _ repository.HierarchicalRepository = (*FileRepository)(nil)
var _ repository.ListableRepository = (*FileRepository)(nil)
var _ repository.MovableRepository = (*FileRepository)(nil)
Expand Down Expand Up @@ -119,14 +119,14 @@ func (r *FileRepository) Destroy(scheme string) {
// do nothing
}

// Writer implements repository.WriteableRepository.Writer
// Writer implements repository.WritableRepository.Writer
//
// Since: 2.0.0
func (r *FileRepository) Writer(u fyne.URI) (fyne.URIWriteCloser, error) {
return openFile(u, true)
}

// CanWrite implements repository.WriteableRepository.CanWrite
// CanWrite implements repository.WritableRepository.CanWrite
//
// Since: 2.0.0
func (r *FileRepository) CanWrite(u fyne.URI) (bool, error) {
Expand All @@ -152,7 +152,7 @@ func (r *FileRepository) CanWrite(u fyne.URI) (bool, error) {
return true, nil
}

// Delete implements repository.WriteableRepository.Delete
// Delete implements repository.WritableRepository.Delete
//
// Since: 2.0.0
func (r *FileRepository) Delete(u fyne.URI) error {
Expand Down
8 changes: 4 additions & 4 deletions internal/repository/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var _ fyne.URIWriteCloser = (*nodeReaderWriter)(nil)

// declare conformance with repository types
var _ repository.Repository = (*InMemoryRepository)(nil)
var _ repository.WriteableRepository = (*InMemoryRepository)(nil)
var _ repository.WritableRepository = (*InMemoryRepository)(nil)
var _ repository.HierarchicalRepository = (*InMemoryRepository)(nil)
var _ repository.CopyableRepository = (*InMemoryRepository)(nil)
var _ repository.MovableRepository = (*InMemoryRepository)(nil)
Expand Down Expand Up @@ -198,7 +198,7 @@ func (m *InMemoryRepository) Destroy(scheme string) {
// do nothing
}

// Writer implements repository.WriteableRepository.Writer
// Writer implements repository.WritableRepository.Writer
//
// Since 2.0.0
func (m *InMemoryRepository) Writer(u fyne.URI) (fyne.URIWriteCloser, error) {
Expand All @@ -210,7 +210,7 @@ func (m *InMemoryRepository) Writer(u fyne.URI) (fyne.URIWriteCloser, error) {
return &nodeReaderWriter{path: path, repo: m}, nil
}

// CanWrite implements repository.WriteableRepository.CanWrite
// CanWrite implements repository.WritableRepository.CanWrite
//
// Since 2.0.0
func (m *InMemoryRepository) CanWrite(u fyne.URI) (bool, error) {
Expand All @@ -221,7 +221,7 @@ func (m *InMemoryRepository) CanWrite(u fyne.URI) (bool, error) {
return true, nil
}

// Delete implements repository.WriteableRepository.Delete
// Delete implements repository.WritableRepository.Delete
//
// Since 2.0.0
func (m *InMemoryRepository) Delete(u fyne.URI) error {
Expand Down
12 changes: 6 additions & 6 deletions storage/repository/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func GenericChild(u fyne.URI, component string) (fyne.URI, error) {
// contents of the source to the destination.
//
// For obvious reasons, the destination URI must have a registered
// WriteableRepository.
// WritableRepository.
//
// NOTE: this function should not be called except by an implementation of
// the Repository interface - using this for unknown URIs may break.
Expand All @@ -126,7 +126,7 @@ func GenericCopy(source fyne.URI, destination fyne.URI) error {
}

// The destination must be writeable.
destwrepo, ok := dstrepo.(WriteableRepository)
destwrepo, ok := dstrepo.(WritableRepository)
if !ok {
return ErrOperationNotSupported
}
Expand All @@ -153,7 +153,7 @@ func GenericCopy(source fyne.URI, destination fyne.URI) error {
// MovableRepository.Move(). It will perform the move by obtaining a reader
// for the source URI, a writer for the destination URI, then writing the
// contents of the source to the destination. Following this, the source
// will be deleted using WriteableRepository.Delete.
// will be deleted using WritableRepository.Delete.
//
// For obvious reasons, the source and destination URIs must both be writable.
//
Expand All @@ -177,13 +177,13 @@ func GenericMove(source fyne.URI, destination fyne.URI) error {
}

// The source and destination must both be writable, since the source
// is being deleted, which requires WriteableRepository.
destwrepo, ok := dstrepo.(WriteableRepository)
// is being deleted, which requires WritableRepository.
destwrepo, ok := dstrepo.(WritableRepository)
if !ok {
return ErrOperationNotSupported
}

srcwrepo, ok := srcrepo.(WriteableRepository)
srcwrepo, ok := srcrepo.(WritableRepository)
if !ok {
return ErrOperationNotSupported
}
Expand Down
4 changes: 2 additions & 2 deletions storage/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ type CustomURIRepository interface {
ParseURI(string) (fyne.URI, error)
}

// WriteableRepository is an extension of the Repository interface which also
// WritableRepository is an extension of the Repository interface which also
// supports obtaining a writer for URIs of the scheme it is registered to.
//
// Since: 2.0.0
type WriteableRepository interface {
type WritableRepository interface {
Repository

// Writer will be used to implement calls to storage.WriterTo() for
Expand Down
10 changes: 5 additions & 5 deletions storage/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func Exists(u fyne.URI) (bool, error) {
// throw an error.
//
// * If the scheme of the given URI does not have a registered
// WriteableRepository instance, then this method will fail with a
// WritableRepository instance, then this method will fail with a
// repository.ErrOperationNotSupported.
//
// Delete is backed by the repository system - this function calls
Expand All @@ -176,7 +176,7 @@ func Delete(u fyne.URI) error {
return err
}

wrepo, ok := repo.(repository.WriteableRepository)
wrepo, ok := repo.(repository.WritableRepository)
if !ok {
return repository.ErrOperationNotSupported
}
Expand Down Expand Up @@ -263,7 +263,7 @@ func CanRead(u fyne.URI) (bool, error) {
// in some way.
//
// * If the scheme of the given URI does not have a registered
// WriteableRepository instance, then this method will fail with a
// WritableRepository instance, then this method will fail with a
// repository.ErrOperationNotSupported.
//
// Writer is backed by the repository system - this function calls into a
Expand All @@ -276,7 +276,7 @@ func Writer(u fyne.URI) (fyne.URIWriteCloser, error) {
return nil, err
}

wrepo, ok := repo.(repository.WriteableRepository)
wrepo, ok := repo.(repository.WritableRepository)
if !ok {
return nil, repository.ErrOperationNotSupported
}
Expand Down Expand Up @@ -304,7 +304,7 @@ func CanWrite(u fyne.URI) (bool, error) {
return false, err
}

wrepo, ok := repo.(repository.WriteableRepository)
wrepo, ok := repo.(repository.WritableRepository)
if !ok {
return false, repository.ErrOperationNotSupported
}
Expand Down

0 comments on commit cf845be

Please sign in to comment.