win

package
v0.0.0-...-4aaebde Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

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

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 win.

Types

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) GetChunk

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

GetChunk returns no data, no 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 no data, no error, every time.

func (*Drive) ListFiles

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

ListFiles returns no data, no error, every time.

func (*Drive) Local

func (s *Drive) Local() bool

Local returns the value of Drive.Local.

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 success, every time.

func (*Drive) PutFile

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

PutFile returns success, every time.

Jump to

Keyboard shortcuts

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