clientinterface

package
v0.0.0-...-339602a Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package clientinterface implements an interface to read and write client data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientRPC

type ClientRPC interface {
	GetKeylist(serverURL string) (*types.RatchetList, error)
	Decrypt(serverURL string, oracleMessage []byte) (responseMessage []byte, err error)
}

ClientRPC is the interface to make calls to the github.com/JonathanLogan/cypherlock.

type DefaultRPC

type DefaultRPC struct {
}

DefaultRPC is the default implementation for RPC.

func (*DefaultRPC) Decrypt

func (dr *DefaultRPC) Decrypt(serverURL string, oracleMessage []byte) (responseMessage []byte, err error)

Decrypt an oracleMessage at the serverURL.

func (*DefaultRPC) GetKeylist

func (dr *DefaultRPC) GetKeylist(serverURL string) (*types.RatchetList, error)

GetKeylist returns the keylist from a server.

type DefaultStorage

type DefaultStorage struct {
	Path string // Storage path
}

DefaultStorage is the default file-backed storage.

func (DefaultStorage) GetKeylist

func (ds DefaultStorage) GetKeylist() (keys *types.RatchetList, err error)

GetKeylist reads a keylist.

func (DefaultStorage) GetLock

func (ds DefaultStorage) GetLock(now uint64) (data []byte, err error)

GetLock returns a matching lock.

func (DefaultStorage) GetSecret

func (ds DefaultStorage) GetSecret() (data []byte, err error)

GetSecret loads a secret.

func (DefaultStorage) StoreKeylist

func (ds DefaultStorage) StoreKeylist(keys *types.RatchetList) error

StoreKeylist stores a keylist.

func (DefaultStorage) StoreLock

func (ds DefaultStorage) StoreLock(filename string, data []byte) error

StoreLock stores a lock.

func (DefaultStorage) StoreSecret

func (ds DefaultStorage) StoreSecret(data []byte) error

StoreSecret stores a secret.

type Storage

type Storage interface {
	StoreLock(filename string, data []byte) error     // Store a lock.
	GetLock(now uint64) (data []byte, err error)      // Return a matching lock.
	StoreKeylist(keys *types.RatchetList) error       // Store a keylist.
	GetKeylist() (keys *types.RatchetList, err error) // Read a keylist.
	StoreSecret(data []byte) error                    // Store a secret.
	GetSecret() (data []byte, err error)              // Load a secret.
}

Storage is the interface to be implemented by storage backends.

Jump to

Keyboard shortcuts

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