github.com/mattyw/juju@v0.0.0-20140610034352-732aecd63861/state/storage/interface.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package storage
     5  
     6  import (
     7  	"io"
     8  )
     9  
    10  // ResourceStorage instances save and retrieve data from an underlying storage implementation.
    11  type ResourceStorage interface {
    12  	// Get returns a reader for the resource located at path.
    13  	Get(path string) (io.ReadCloser, error)
    14  
    15  	// Put writes data from the specified reader to path and returns a checksum of the data written.
    16  	Put(path string, r io.Reader, length int64) (checksum string, err error)
    17  
    18  	// Remove deletes the data at the specified path.
    19  	Remove(path string) error
    20  }