eos

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessReq

type AccessReq struct {
	Patient eos.AccountName `json:"patient"`
	Account eos.AccountName `json:"account"`
}

AccessReq contains fields needed in sending access-contract related actions

type Storage

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

func New

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

New sets the connection to nodeos API up and adds keybag signer

func (*Storage) AccessGranted

func (s *Storage) AccessGranted(patient, to string) (bool, error)

AccessGranted checks if connection between `patient` and `to` is establisehd return true if connection is established and false if it is not Due to uint32 limitations this functions allows connection for up to 4294967295 doctors to a single client

func (*Storage) CheckAccountExists

func (s *Storage) CheckAccountExists(account string) bool

func (*Storage) CheckAccountKey

func (s *Storage) CheckAccountKey(account, key string) (bool, error)

CheckAccountKey checks if the key is authority of account

func (*Storage) CreateAccount

func (s *Storage) CreateAccount(account, keyStr string) error

CreateAccount creates account named `account` using key `keyStr`

func (*Storage) DeployContract

func (s *Storage) DeployContract() error

DeployContract pushes contract located in contract/eos to blockchain under name specified in config

func (*Storage) GrantAccess

func (s *Storage) GrantAccess(to string) error

GrantAccess adds `to` field in contract table

func (*Storage) ImportKey

func (s *Storage) ImportKey(prkey string) (*ecc.PrivateKey, error)

ImportKey imports private key returns privatekey struct or error

func (*Storage) ListConnected

func (s *Storage) ListConnected(patient string) ([]string, error)

func (*Storage) NewKey

func (s *Storage) NewKey() error

NewKey creates new private key and saves it to config

func (*Storage) RevokeAccess

func (s *Storage) RevokeAccess(to string) error

RevokeAccess changes isEnabled field in table to 0

func (*Storage) SignByte

func (s *Storage) SignByte(data []byte) (string, error)

func (*Storage) SignHash

func (s *Storage) SignHash(data []byte) (string, error)

Sign creates string signature of data

type TableEntry

type TableEntry struct {
	AccountName string `json:"account_name"`
}

Jump to

Keyboard shortcuts

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