ports

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

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

Go to latest
Published: Jan 5, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockchainPort

type BlockchainPort interface {
	FindTxByHash(string) (*dto.Transaction, error)
}

type CryptoPort

type CryptoPort interface {
	HashDigest(src []byte) string
	Verify(pubkey, msg, signature []byte) bool
}

type DownloadFileParams

type DownloadFileParams struct {
	Token  entities.FileID
	TxHash string
}

type DownloadFileResponse

type DownloadFileResponse struct {
	Content []byte `json:"content"`
}

type ServerInputPort

type ServerInputPort interface {
	UploadFile(*UploadFileParams) (*UploadFileResponse, error)
	DownloadFile(*DownloadFileParams) (*DownloadFileResponse, error)
}

type ServerOutputPort

type ServerOutputPort interface {
	UploadFile(token entities.FileID) (*UploadFileResponse, error)
	DownloadFile(content io.Reader) (*DownloadFileResponse, error)
}

type StoragePort

type StoragePort interface {
	Upload(name string, content io.Reader) (string, error)
	Download(name string) (io.ReadCloser, error)
}

type UploadFileParams

type UploadFileParams struct {
	Content   io.Reader
	Signature []byte
	PubKey    []byte
}

type UploadFileResponse

type UploadFileResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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