composition

package
v0.0.0-...-4eea697 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

type Compressor interface {
	Compress(decompressedData []byte) (compressedData []byte, err error)
}

type DocumentsSvc

type DocumentsSvc interface {
	GetDocFromStorageByID(ctx context.Context, userID, systemID string, CID *cid.Cid, authData, docIDEncrypted []byte) ([]byte, error)
	GetDocAccessKey(ctx context.Context, userID, systemID string, CID *cid.Cid) (*chachaPoly.Key, error)
	DecryptKey(userID string, encryptedKey []byte) (*chachaPoly.Key, error)
}

type FileCoinService

type FileCoinService interface {
	StartDeal(ctx context.Context, CID *cid.Cid, dataSizeBytes uint64) (*cid.Cid, string, error)
}

type GroupAccessService

type GroupAccessService interface {
	Default() *uuid.UUID
}

type Indexer

type Indexer interface {
	MultiCallEhrNew() *indexer.MultiCallTx
	GetDocByVersion(ctx context.Context, ehrUUID *uuid.UUID, docType types.DocumentType, docBaseUIDHash, version *[32]byte) (*model.DocumentMeta, error)
	AddEhrDoc(docType types.DocumentType, docMeta *model.DocumentMeta, privKey *[32]byte) ([]byte, error)
	GetDocLastByBaseID(ctx context.Context, userID, systemID string, docType types.DocumentType, docBaseUIDHash *[32]byte) (*model.DocumentMeta, error)
	DeleteDoc(ctx context.Context, ehrUUID *uuid.UUID, docType types.DocumentType, docBaseUIDHash, version, privKey *[32]byte) (string, error)
	ListDocByType(ctx context.Context, userID, systemID string, docType types.DocumentType) ([]model.DocumentMeta, error)
	DataUpdate(ctx context.Context, groupID, dataID, ehrID *uuid.UUID, data []byte) (string, error)
	SetAccessWrapper(subjectIDHash *[32]byte, accessObj *indexer.AccessObject, userPrivKey *[32]byte) ([]byte, error)
}

type IpfsService

type IpfsService interface {
	Add(ctx context.Context, fileContent []byte) (*cid.Cid, error)
}

type KeyStore

type KeyStore interface {
	Get(userID string) (publicKey, privateKey *[32]byte, err error)
}

type Service

type Service struct {
	helper.Finder
	// contains filtered or unexported fields
}

func NewCompositionService

func NewCompositionService(
	indexer Indexer,
	ipfs IpfsService,
	fileCoin FileCoinService,
	keyStore KeyStore,
	compressor Compressor,
	docSvc DocumentsSvc,
	groupAccessService GroupAccessService,
) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, userID, systemID string, ehrUUID, groupAccessUUID *uuid.UUID, composition *model.Composition, procRequest *proc.Request) (*model.Composition, error)

func (*Service) DefaultGroupAccess

func (s *Service) DefaultGroupAccess() *uuid.UUID

func (*Service) DeleteByID

func (s *Service) DeleteByID(ctx context.Context, procRequest *proc.Request, ehrUUID *uuid.UUID, versionUID, userID, systemID string) (string, error)

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, userID, systemID string, ehrUUID *uuid.UUID, versionUID string) (*model.Composition, error)

func (*Service) GetLastByBaseID

func (s *Service) GetLastByBaseID(ctx context.Context, userID, systemID string, ehrUUID *uuid.UUID, versionUID string) (*model.Composition, error)

func (*Service) GetList

func (s *Service) GetList(ctx context.Context, userID, systemID string) ([]*model.EhrDocumentItem, error)

func (*Service) IsExist

func (s *Service) IsExist(ctx context.Context, args ...string) (bool, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, procRequest *proc.Request, userID, systemID string, ehrUUID, groupAccessUUID *uuid.UUID, composition *model.Composition) (*model.Composition, error)

Jump to

Keyboard shortcuts

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