fs

package
v0.0.0-...-b84eec1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSatisfiable      = errors.New("try again later")
	ErrInvalidSignature    = errors.New("login.error.invalidSignature")
	ErrNoPermission        = errors.New("proxeusFS permission denied")
	ErrFileRemoved         = errors.New("file has been removed")
	ErrFileNotReady        = errors.New("file isn't ready yet")
	ErrPaymentDoesNotMatch = errors.New("spp: received and calculated xes do not match")
)
View Source
var ErrFileNotPGPEncrypted = errors.New("file not pgp encrypted")
View Source
var ErrReplacingExistingFileSize = errors.New("cannot replace file. Size of new and existing file differ to much")
View Source
var ErrSppFileMetaNotFound = errors.New("SPP file meta not found")

Functions

func NewFileMetaClientMock

func NewFileMetaClientMock(proxeusFSFileMocks []*FileInfoMock) *fileMetaHandlerMock

func NewFileMetaHandler

func NewFileMetaHandler(storageDir string) (*fileMetaHandler, error)

Types

type FileInfo

type FileInfo struct {
	Id             [32]byte
	Ownr           common.Address
	FileType       *big.Int
	Removed        bool
	Expiry         *big.Int
	IsPublic       bool
	ThumbnailHash  [32]byte
	Fparent        [32]byte
	ReplacesFile   [32]byte
	ReadAccess     []common.Address
	DefinedSigners []common.Address
}

type FileInfoMock

type FileInfoMock struct {
	Id     [32]byte
	Expiry *big.Int
}

type FileMetaHandlerInterface

type FileMetaHandlerInterface interface {
	Get(fileHash common.Hash) (*sppFileMeta, error)
	All() ([]*sppFileMeta, error)
	Remove(fileHash common.Hash)
	Save(fileInfo FileInfo)
	Manipulate(manipulatedFileInfo FileInfoMock)
}

type FsClientInterface

type FsClientInterface interface {
	FileInfo(fileHash [32]byte, readFromCache bool) (FileInfo, error)
	SpInfoForFile(fileHash string) (string, error)
	GetFilePayment(fhash common.Hash) (*big.Int, error)
	HasWriteRights(fileHash [32]byte, addr common.Address, readFromCache bool) (bool, error)
	HasReadRights(fileHash [32]byte, addr common.Address, readFromCache bool) (bool, error)
	Close() error
}

type ProxeusFS

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

func NewProxeusFS

func NewProxeusFS(cfg *config.Configuration, ethConn FsClientInterface, fileMetaHandler FileMetaHandlerInterface, providerInfoService service.ProviderInfoService) (*ProxeusFS, error)

func (*ProxeusFS) CheckForExpiredFiles

func (me *ProxeusFS) CheckForExpiredFiles()

func (*ProxeusFS) Close

func (me *ProxeusFS) Close() (err error)

func (*ProxeusFS) CreateSignInChallenge

func (me *ProxeusFS) CreateSignInChallenge() (*SignMsg, error)

func (*ProxeusFS) Input

func (me *ProxeusFS) Input(docHash, token, signatureHex string, body io.Reader, duration int) (written int64, err error)

func (*ProxeusFS) Output

func (me *ProxeusFS) Output(docHashString, token, signatureHex string, force bool) (n string, err error)

func (*ProxeusFS) Validate

func (me *ProxeusFS) Validate(token, signatureHex string) (addr string, err error)

type ProxeusFSDeleteEvent

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

func NewProxeusFSDeleteEvent

func NewProxeusFSDeleteEvent(cfg *config.Configuration) (*ProxeusFSDeleteEvent, error)

func (*ProxeusFSDeleteEvent) Close

func (me *ProxeusFSDeleteEvent) Close()

func (*ProxeusFSDeleteEvent) StartSubscribeDeleteHandler

func (me *ProxeusFSDeleteEvent) StartSubscribeDeleteHandler()

type SignMsg

type SignMsg struct {
	Token     string `json:"token"`
	Challenge string `json:"challenge"`
}

type SpAddress

type SpAddress struct {
	Address string `json:"address"`
	Url     string `json:"url"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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