Documentation ¶
Overview ¶
Package file is the file manipulation library that we will use for peerstore
Index ¶
- func Delete(path string, key [20]byte) error
- func DeleteFileHandler(ctx context.Context, r *protocol.Request) protocol.Response
- func Get(path string, key [20]byte) (io.ReadCloser, error)
- func GetFileHandler(ctx context.Context, r *protocol.Request) protocol.Response
- func GetPublicKeyHandler(ctx context.Context, r *protocol.Request) protocol.Response
- func GetTransactionLog(thisID models.Identifier, peer models.Node, userKey *rsa.PublicKey, ...) (models.TransactionLog, error)
- func Post(path string, key [20]byte, data io.Reader) error
- func PostFileHandler(ctx context.Context, r *protocol.Request) protocol.Response
- func PostPublicKeyHandler(ctx context.Context, r *protocol.Request) protocol.Response
- func PutTransactionLog(thisID models.Identifier, peer models.Node, userKey *rsa.PublicKey, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFileHandler ¶
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 ¶
GetFileHandler - This is the server handler which manages Get File Requests
func GetPublicKeyHandler ¶
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 ¶
Post - create or update a file based on the key, returns boolean success as well as an error
func PostFileHandler ¶
PostFileHandler - This is the server handler which manages Post File Requests
func PostPublicKeyHandler ¶
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.