Documentation ¶
Overview ¶
Package win is a test client. It implements the Shade drive.Client API, and silently succeeds any attempted operation. Read requests return nil for the value, as well as the error. You may configure it to appear as a Local client, or not.
Index ¶
- func NewClient(c drive.Config) (drive.Client, error)
- type ChunkLister
- type Drive
- func (s *Drive) GetChunk(sha256sum []byte, f *shade.File) ([]byte, error)
- func (s *Drive) GetConfig() drive.Config
- func (s *Drive) GetFile(sha256sum []byte) ([]byte, error)
- func (s *Drive) ListFiles() ([][]byte, error)
- func (s *Drive) Local() bool
- func (s *Drive) NewChunkLister() drive.ChunkLister
- func (s *Drive) Persistent() bool
- func (s *Drive) PutChunk(sha256sum []byte, chunk []byte, f *shade.File) error
- func (s *Drive) PutFile(sha256sum, f []byte) error
- func (s *Drive) ReleaseChunk(sha256sum []byte) error
- func (s *Drive) ReleaseFile(sha256sum []byte) error
- func (s *Drive) Warm(chunks [][]byte, f *shade.File)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChunkLister ¶
type ChunkLister struct { }
ChunkLister allows iterating the complete lack of chunks.
func (*ChunkLister) Next ¶
func (c *ChunkLister) Next() bool
Next always returns false, because there are no chunks.
func (*ChunkLister) Sha256 ¶
func (c *ChunkLister) Sha256() []byte
Sha256 returns nil. It should never be called, because there are no chunks.
type Drive ¶
type Drive struct {
// contains filtered or unexported fields
}
Drive is a test client implementation which silently succeeds every operation. If you provide an OAuthConfig.ClientID, Local will report false and Persistent will report true.
func (*Drive) NewChunkLister ¶
func (s *Drive) NewChunkLister() drive.ChunkLister
NewChunkLister returns an iterator which returns no chunks, no errors.
func (*Drive) Persistent ¶
Persistent returns whether the storage is persistent across task restarts.
func (*Drive) ReleaseChunk ¶
ReleaseChunk returns success, every time.
func (*Drive) ReleaseFile ¶
ReleaseFile returns success, every time.