storage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 8 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 string, key [32]byte, salt [128]byte) (*model.Profile, error)

ReadProfile reads a profile from storage and returns the profile Should only be called for cache refresh of the profile after a ProfileWriterStore has opened

(and upgraded) the store, and thus supplied the key/salt

Types

type ProfileStore

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

ProfileStore is an interface to managing the storage of Cwtch Profiles

func CreateProfileWriterStore added in v0.3.9

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

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

func LoadProfileWriterStore added in v0.3.9

func LoadProfileWriterStore(eventManager event.Manager, directory, password string) (ProfileStore, error)

LoadProfileWriterStore loads a profile store from filestore listening for events and saving them directory should be $appDir/profiles/$rand

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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