v0

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadProfile

func ReadProfile(directory, password string) (*model.Profile, error)

ReadProfile reads a profile from storqage and returns the profile directory should be $appDir/profiles/$rand

Types

type FileStore

type FileStore interface {
	Read() ([]byte, error)
	Write(data []byte) error
}

FileStore is a primitive around storing encrypted files

func NewFileStore

func NewFileStore(directory string, filename string, password string) FileStore

NewFileStore instantiates a fileStore given a filename and a password

type ProfileStoreV0

type ProfileStoreV0 struct {
	// contains filtered or unexported fields
}

ProfileStoreV0 is a legacy profile store used now for upgrading legacy profile stores to newer versions

func NewProfileWriterStore

func NewProfileWriterStore(eventManager event.Manager, directory, password string, profile *model.Profile) *ProfileStoreV0

NewProfileWriterStore returns a profile store backed by a filestore listening for events and saving them directory should be $appDir/profiles/$rand

func (*ProfileStoreV0) AddGroup

func (ps *ProfileStoreV0) AddGroup(invite string)

AddGroup For testing, adds a group to the profile (and starts a stream store)

func (*ProfileStoreV0) AddGroupMessage

func (ps *ProfileStoreV0) AddGroupMessage(groupid string, timeSent, timeRecvied string, remotePeer, data string)

AddGroupMessage for testing, adds a group message

func (*ProfileStoreV0) GetNewPeerMessage

func (ps *ProfileStoreV0) GetNewPeerMessage() *event.Event

GetNewPeerMessage is for AppService to call on Reload events, to reseed the AppClient with the loaded peers

func (*ProfileStoreV0) Load

func (ps *ProfileStoreV0) Load() error

Load instantiates a cwtchPeer from the file store

func (*ProfileStoreV0) Shutdown

func (ps *ProfileStoreV0) Shutdown()

Shutdown saves the storage system

type StreamStore

type StreamStore interface {
	Read() []model.Message
	Write(m model.Message)
}

StreamStore provides a stream like interface to encrypted storage

func NewStreamStore

func NewStreamStore(directory string, filenameBase string, password string) (store StreamStore)

NewStreamStore returns an initialized StreamStore ready for reading and writing

Jump to

Keyboard shortcuts

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