file

package
v0.0.0-...-f3f2e11 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package file is the file manipulation library that we will use for peerstore

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(path string, key [20]byte) error

Delete - delete a file based on the key, returns boolean success as well as an error

func DeleteFileHandler

func DeleteFileHandler(ctx context.Context, r *protocol.Request) protocol.Response

DeleteFileHandler - This is the server handler which manages Delete File Requests

func Get

func Get(path string, key [20]byte) (io.ReadCloser, error)

Get - get a file based on the key, returns an io.Reader which will be used to read the file

func GetFileHandler

func GetFileHandler(ctx context.Context, r *protocol.Request) protocol.Response

GetFileHandler - This is the server handler which manages Get File Requests

func GetPublicKeyHandler

func GetPublicKeyHandler(ctx context.Context, r *protocol.Request) protocol.Response

GetPublicKeyHandler - This is the server handler which manages Get public key

func GetTransactionLog

func GetTransactionLog(thisID models.Identifier, peer models.Node, userKey *rsa.PublicKey, selfKey *rsa.PrivateKey) (models.TransactionLog, error)

func Post

func Post(path string, key [20]byte, data io.Reader) error

Post - create or update a file based on the key, returns boolean success as well as an error

func PostFileHandler

func PostFileHandler(ctx context.Context, r *protocol.Request) protocol.Response

PostFileHandler - This is the server handler which manages Post File Requests

func PostPublicKeyHandler

func PostPublicKeyHandler(ctx context.Context, r *protocol.Request) protocol.Response

PostPublicKeyHandler - This is the server handler which manages key posts

func PutTransactionLog

func PutTransactionLog(thisID models.Identifier, peer models.Node, userKey *rsa.PublicKey, selfKey *rsa.PrivateKey, transactionLog models.TransactionLog) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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