Documentation ¶
Overview ¶
Package clientinterface implements an interface to read and write client data.
Index ¶
- type ClientRPC
- type DefaultRPC
- type DefaultStorage
- func (ds DefaultStorage) GetKeylist() (keys *types.RatchetList, err error)
- func (ds DefaultStorage) GetLock(now uint64) (data []byte, err error)
- func (ds DefaultStorage) GetSecret() (data []byte, err error)
- func (ds DefaultStorage) StoreKeylist(keys *types.RatchetList) error
- func (ds DefaultStorage) StoreLock(filename string, data []byte) error
- func (ds DefaultStorage) StoreSecret(data []byte) error
- type Storage
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)
func (DefaultStorage) GetLock ¶
func (ds DefaultStorage) GetLock(now uint64) (data []byte, err error)
func (DefaultStorage) GetSecret ¶
func (ds DefaultStorage) GetSecret() (data []byte, err error)
func (DefaultStorage) StoreKeylist ¶
func (ds DefaultStorage) StoreKeylist(keys *types.RatchetList) error
func (DefaultStorage) StoreLock ¶
func (ds DefaultStorage) StoreLock(filename string, data []byte) error
func (DefaultStorage) StoreSecret ¶
func (ds DefaultStorage) StoreSecret(data []byte) error
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.
Click to show internal directories.
Click to hide internal directories.