remoteRPC

package
v0.0.0-...-3e63800 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticatePatient

func AuthenticatePatient(msg string, signature string) (string, error)

AuthenticateProvider verifies that the provided message was signed by a provider message is current time in seconds formatted as a string signature is the signature of the current time returns the patient account

func AuthenticateProvider

func AuthenticateProvider(msg string, signature string) (string, error)

AuthenticateProvider verifies that the provided message was signed by a provider message is current time in seconds formatted as a string signature is the signature of the current time returns provider account

func GetMedRecRemoteRPCConn

func GetMedRecRemoteRPCConn() (*rpc.Client, string, error)

GetMedRecRemoteRPCConn returns a connection to a random provider

func ListenandServe

func ListenandServe(router *mux.Router)

ListenandServe remote connections

Types

type AddPermissionArgs

type AddPermissionArgs struct {
	AgentID      string
	ViewerGroup  string
	Name         string
	StartTime    int64
	DurationDays int64
}

type AddPermissionReply

type AddPermissionReply struct {
	Error string
}

type ChangeAccountArgs

type ChangeAccountArgs struct {
	Account   string
	Time      string
	Signature string
}

type ChangeAccountReply

type ChangeAccountReply struct {
}

type CheckPermissionArgs

type CheckPermissionArgs struct {
	AgentID     string
	ViewerGroup string
	Index       int
}

type CheckPermissionReply

type CheckPermissionReply struct {
	Approved bool
	Error    string
}

type GetPermissionsArgs

type GetPermissionsArgs struct {
	AgentID     string
	ViewerGroup string
}

type GetPermissionsReply

type GetPermissionsReply struct {
	Permissions []Permission
	Error       string
}

type GetProviderAccountArgs

type GetProviderAccountArgs struct {
	Time      string //unix time encoded into a hex string
	Signature string //signature of the time
}

type GetProviderAccountReply

type GetProviderAccountReply struct {
	Account string
}

type MedRecRemote

type MedRecRemote struct {
}

MedRecRemote interface for all the rpc methods

func (*MedRecRemote) AddPermission

func (client *MedRecRemote) AddPermission(r *http.Request, args *AddPermissionArgs, reply *AddPermissionReply) error

func (*MedRecRemote) ChangeAccount

func (client *MedRecRemote) ChangeAccount(r *http.Request, args *ChangeAccountArgs, reply *ChangeAccountReply) error

ChangeAccount transfers the mapping from patient account to unique identifier to a different account

func (*MedRecRemote) CheckPermission

func (client *MedRecRemote) CheckPermission(r *http.Request, args *CheckPermissionArgs, reply *CheckPermissionReply) error

utility function for checking the access permissions of a particular viewer

func (*MedRecRemote) GetPermissions

func (client *MedRecRemote) GetPermissions(r *http.Request, args *GetPermissionsArgs, reply *GetPermissionsReply) error

func (*MedRecRemote) GetProviderAccount

func (client *MedRecRemote) GetProviderAccount(r *http.Request, args *GetProviderAccountArgs, reply *GetProviderAccountReply) error

func (*MedRecRemote) PatientDocuments

func (client *MedRecRemote) PatientDocuments(r *http.Request, args *PatientDocumentsArgs, reply *PatientDocumentsReply) error

returns a pointer to an sql database.

func (*MedRecRemote) PatientFaucet

func (client *MedRecRemote) PatientFaucet(r *http.Request, args *PatientFaucetArgs, reply *PatientFaucetReply) error

PatientFaucet takes an ethereum account and gives it some ether Message and Signature should be from the patient Account should refer to the Provider's account that money should be sent from

func (*MedRecRemote) ProviderFaucet

func (client *MedRecRemote) ProviderFaucet(r *http.Request, args *ProviderFaucetArgs, reply *ProviderFaucetReply) error

ProviderFaucet takes an ethereum account and gives it some ether The Message and Signature should be from the requesting provider The Account should be of the patient to whom funds should be sent

func (*MedRecRemote) RemovePermission

func (client *MedRecRemote) RemovePermission(r *http.Request, args *RemovePermissionArgs, reply *RemovePermissionReply) error

func (*MedRecRemote) SetPermissionDuration

func (client *MedRecRemote) SetPermissionDuration(r *http.Request, args *AddPermissionArgs, reply *AddPermissionReply) error

func (*MedRecRemote) SetPermissionStartTime

func (client *MedRecRemote) SetPermissionStartTime(r *http.Request, args *AddPermissionArgs, reply *AddPermissionReply) error

type PatientDocumentsArgs

type PatientDocumentsArgs struct {
	PatientID int
	Time      string
	Signature string
}

type PatientDocumentsReply

type PatientDocumentsReply struct {
	//restructure as a JSON string
	Documents common.Documents
	Error     string
}

type PatientFaucetArgs

type PatientFaucetArgs struct {
	Account   string // the provider account to provide the refund
	Time      string // the current time
	Signature string // signature of the current time
}

type PatientFaucetReply

type PatientFaucetReply struct {
	Error string
	Txid  string
}

type Permission

type Permission struct {
	Name         string
	StartTime    int64
	DurationDays int64
}

type ProviderFaucetArgs

type ProviderFaucetArgs struct {
	RecipientAccount string // the patient account to recieve the funds
	SendingAccount   string // the provider account providing the funds
	Time             string // the current time
	Signature        string // signature of the current time
}

type ProviderFaucetReply

type ProviderFaucetReply struct {
	Error string
	Txid  string
}

type RemovePermissionArgs

type RemovePermissionArgs struct {
	AgentID     string
	ViewerGroup string
	Index       uint
}

type RemovePermissionReply

type RemovePermissionReply struct {
	Error string
}

Jump to

Keyboard shortcuts

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