fail

package
v0.0.0-...-c426cd6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package fail is a test client. It implements the Shade drive.Client API, and fails any attempted operation. You may configure it to appear as a Local client, or not.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(c drive.Config) (drive.Client, error)

NewClient returns a client which will always fail.

Types

type ChunkLister

type ChunkLister struct {
}

ChunkLister allows iterating the complete lack of chunks.

func (*ChunkLister) Err

func (c *ChunkLister) Err() error

Err returns an error, every time.

func (*ChunkLister) Next

func (c *ChunkLister) Next() bool

Next always returns false, to indicate an error.

func (*ChunkLister) Sha256

func (c *ChunkLister) Sha256() []byte

Sha256 returns nil, because there are no chunks.

type Drive

type Drive struct {
	// contains filtered or unexported fields
}

Drive is a test client implementation which fails every operation. If you provide any OAuthConfig its will return false for Local.

func (*Drive) GetChunk

func (s *Drive) GetChunk(sha256sum []byte, f *shade.File) ([]byte, error)

GetChunk returns an error, every time.

func (*Drive) GetConfig

func (s *Drive) GetConfig() drive.Config

GetConfig returns an empty config.

func (*Drive) GetFile

func (s *Drive) GetFile(sha256sum []byte) ([]byte, error)

GetFile returns an error, every time.

func (*Drive) ListFiles

func (s *Drive) ListFiles() ([][]byte, error)

ListFiles returns an error, every time.

func (*Drive) Local

func (s *Drive) Local() bool

Local returns true, unless any OAuthConfig is provided.

func (*Drive) NewChunkLister

func (s *Drive) NewChunkLister() drive.ChunkLister

NewChunkLister returns an iterator which returns an error for every request.

func (*Drive) Persistent

func (s *Drive) Persistent() bool

Persistent returns whether the storage is persistent across task restarts.

func (*Drive) PutChunk

func (s *Drive) PutChunk(sha256sum []byte, chunk []byte, f *shade.File) error

PutChunk returns an error, every time.

func (*Drive) PutFile

func (s *Drive) PutFile(sha256sum, f []byte) error

PutFile returns an error, every time.

func (*Drive) ReleaseChunk

func (s *Drive) ReleaseChunk(sha256sum []byte) error

ReleaseChunk returns an error, every time.

func (*Drive) ReleaseFile

func (s *Drive) ReleaseFile(sha256sum []byte) error

ReleaseFile returns an error, every time.

func (*Drive) Warm

func (s *Drive) Warm(chunks [][]byte, f *shade.File)

Warm is unnecessary for this client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL