clientinterface

package
v0.0.0-...-7c02103 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: BSD-3-Clause 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)

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.

Jump to

Keyboard shortcuts

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