Documentation ¶
Index ¶
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type AccessToken
- type ComplexityRoot
- type Config
- type ConsentEnforcement
- type Contract
- type DataType
- type DataTypeDocument
- type DirectiveRoot
- type Group
- type MutationResolver
- type Patient
- type Practioner
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type AccessToken ¶
type ComplexityRoot ¶
type ComplexityRoot struct { AccessToken struct { Expiration func(childComplexity int) int ID func(childComplexity int) int PatientID func(childComplexity int) int PractionerID func(childComplexity int) int UUID func(childComplexity int) int } ConsentEnforcement struct { Display func(childComplexity int) int Expiration func(childComplexity int) int ID func(childComplexity int) int ReaderGroups func(childComplexity int) int TargetGroups func(childComplexity int) int UUID func(childComplexity int) int } Contract struct { Clauses func(childComplexity int) int Display func(childComplexity int) int Hash func(childComplexity int) int ID func(childComplexity int) int ReaderGroups func(childComplexity int) int UUID func(childComplexity int) int } DataType struct { Display func(childComplexity int) int ID func(childComplexity int) int UUID func(childComplexity int) int } Group struct { Display func(childComplexity int) int ID func(childComplexity int) int IsPublic func(childComplexity int) int UUID func(childComplexity int) int } Mutation struct { CreateConsentEnforcementRule func(childComplexity int, display string, readerGroups []string, targetGroups []string, expiration int) int CreateContract func(childComplexity int, display string, clauses []string) int CreateDataType func(childComplexity int, display string) int CreateGroup func(childComplexity int, display string) int CreatePatient func(childComplexity int, display string, groups []string, dataTypes []string) int CreatePractioner func(childComplexity int, display string, groups []string) int GiveConsent func(childComplexity int, patientID string, contractID string, expiration int) int PatientResetPassphase func(childComplexity int, patientID string, restorePhrase string) int PractionerResetPassphase func(childComplexity int, practionerID string, restorePhrase string) int } Patient struct { DataTypes func(childComplexity int) int Display func(childComplexity int) int Groups func(childComplexity int) int ID func(childComplexity int) int Passprase func(childComplexity int) int PrivateKey func(childComplexity int) int PublicKey func(childComplexity int) int RestorePhrase func(childComplexity int) int UUID func(childComplexity int) int } Practioner struct { Display func(childComplexity int) int Groups func(childComplexity int) int ID func(childComplexity int) int Passprase func(childComplexity int) int PrivateKey func(childComplexity int) int PublicKey func(childComplexity int) int RestorePhrase func(childComplexity int) int UUID func(childComplexity int) int } Query struct { Consent func(childComplexity int, patientID string, practionerID string, dataTypeID *string) int ConsentEnforcement func(childComplexity int, patientID string, practionerID string, reason string) int DataTypes func(childComplexity int, limit *int, offset *int) int PublicGroups func(childComplexity int, display *string, limit *int, offset *int) int } Signature struct { ContractID func(childComplexity int) int ContractedSignedHash func(childComplexity int) int Expiration func(childComplexity int) int ID func(childComplexity int) int PatientID func(childComplexity int) int TargetGroup func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
func NewRootResolvers ¶
func NewRootResolvers() Config
NewRootResolvers works a root resolver for other ones
type ConsentEnforcement ¶
type DataType ¶
type DataType struct { ID string `json:"id"` Display string `json:"display"` UUID string `json:"uuid"` }
func StoreDataType ¶
StoreDataType stores the DataTypeDocument
type DataTypeDocument ¶
type DataTypeDocument struct { DBId string `json:"_id"` // Revision string `json:"_revision"` ID string `json:"id"` Display string `json:"display"` UUID string `json:"uuid"` *DataType }
DataTypeDocument mapping from DataType to a document on couchdb
func DataTypeByID ¶
func DataTypeByID(ID string) (*DataTypeDocument, error)
DataTypeByID loads the DataTypeDocument by its ID
func MappingFromDataType ¶
func MappingFromDataType(src *DataType) *DataTypeDocument
MappingFromDataType maps DataType to a document
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type MutationResolver interface { CreateDataType(ctx context.Context, display string) (*DataType, error) CreateGroup(ctx context.Context, display string) (*Group, error) CreatePatient(ctx context.Context, display string, groups []string, dataTypes []string) (*Patient, error) CreatePractioner(ctx context.Context, display string, groups []string) (*Practioner, error) CreateConsentEnforcementRule(ctx context.Context, display string, readerGroups []string, targetGroups []string, expiration int) (*ConsentEnforcement, error) CreateContract(ctx context.Context, display string, clauses []string) (*Contract, error) GiveConsent(ctx context.Context, patientID string, contractID string, expiration int) (*Signature, error) PatientResetPassphase(ctx context.Context, patientID string, restorePhrase string) (*Patient, error) PractionerResetPassphase(ctx context.Context, practionerID string, restorePhrase string) (*Practioner, error) }
type Patient ¶
type Patient struct { ID string `json:"id"` Display string `json:"display"` UUID string `json:"uuid"` PrivateKey string `json:"privateKey"` PublicKey string `json:"publicKey"` Groups []*Group `json:"groups"` DataTypes []*DataType `json:"dataTypes"` RestorePhrase string `json:"restorePhrase"` Passprase string `json:"passprase"` }
type Practioner ¶
type QueryResolver ¶
type QueryResolver interface { DataTypes(ctx context.Context, limit *int, offset *int) ([]*DataType, error) PublicGroups(ctx context.Context, display *string, limit *int, offset *int) ([]*Group, error) Consent(ctx context.Context, patientID string, practionerID string, dataTypeID *string) (*AccessToken, error) ConsentEnforcement(ctx context.Context, patientID string, practionerID string, reason string) (*AccessToken, error) }
type Resolver ¶
type Resolver struct{}
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.