state

package
v0.0.0-...-d4bae03 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageKeyIsDoctor       = "IS_DOCTOR"
	StorageKeyEosPrivate     = "EOS_PRIVATE"
	StorageKeyEosAccount     = "EOS_ACCOUNT"
	StorageKeyPersonalData   = "PERSONAL_DATA"
	StorageKeyEncryptionKeys = "ENCRYPTION_KEYS"
	StorageKeyRSAKey         = "RSA_KEY"
	StorageKeyConnections    = "CONNECTIONS"
	StorageKeyDirectory      = "DIRECTORY"
)

Variables

This section is empty.

Functions

func NewPersitentStorage

func NewPersitentStorage(path string, key []byte, log *logger.Log) (*persistentStorage, error)

Types

type Connections

type Connections struct {
	WithKey    []string           // Access is written on the blockchain and we have the key
	WithoutKey []string           // Access has been written on the blockchain, but we do not have the key
	GrantedTo  []string           // We have granted the access to our data to these users. Its on them to make key request
	Requested  map[string]Request // They are not connected to us, but request for key has been made
}

type Request

type Request struct {
	Key        *rsa.PublicKey
	CustomData string
}

type State

type State struct {
	Token          string
	Connected      bool
	Subscribed     bool
	IsDoctor       bool
	EosPrivate     string `env:"EOS_PRIVATE"`
	EosAccount     string `env:"EOS_ACCOUNT"`
	PersonalData   *openEHR.PersonalData
	EncryptionKeys map[string][]byte
	RSAKey         *rsa.PrivateKey
	Connections    Connections
	Directory      map[string]string
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config, log *logger.Log) (*State, error)

func (*State) Close

func (s *State) Close() error

func (*State) GetEosPublicKey

func (s *State) GetEosPublicKey() string

func (*State) GetNames

func (s *State) GetNames(list []string) map[string]string

func (*State) Save

func (s *State) Save() error

Jump to

Keyboard shortcuts

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