storage

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProfile

func NewProfile(name string) *model.Profile

NewProfile creates a new profile for use in the profile store.

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 {
	Save([]byte) error
	Load() ([]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 ProfileStore

type ProfileStore interface {
	Load() error
	Shutdown()
	GetProfileCopy(timeline bool) *model.Profile
	GetNewPeerMessage() *event.Event
	GetStatusMessages() []*event.Event
}

ProfileStore is an interface to managing the storage of Cwtch Profiles

func NewProfileWriterStore

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

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

type StreamStore

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

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