repository

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticityRepository

type AuthenticityRepository interface {
	SignWithLocalKey(ctx context.Context, data []byte, localKey key.LocalKey) (string, *record.Record, error)
	SignWithManagedKey(ctx context.Context, data []byte, managedKey key.ManagedKey, accessControl *key.AccessControl) (string, *record.Record, error)
	SignWithLocalCertificate(ctx context.Context, data []byte, localCertificate key.LocalCertificate) (string, *record.Record, error)
	SignWithManagedCertificate(ctx context.Context, data []byte, managedCertificate key.ManagedCertificate, accessControl *key.AccessControl) (string, *record.Record, error)
}

type AvailabilityRepository

type AvailabilityRepository interface {
	UploadHosted(ctx context.Context, file *domain.File, record record.Record) (string, error)
	UploadIpfs(ctx context.Context, file *domain.File, record record.Record) (string, error)
	UploadLocal(ctx context.Context, file *domain.File) (string, error)
	UploadTmp(ctx context.Context, file *domain.File, record record.Record) (string, error)
	RetrieveTmp(ctx context.Context, filename string) ([]byte, error)
	RetrieveLocal(ctx context.Context, filePath string) ([]byte, error)
	FindFile(ctx context.Context, dataID string) ([]byte, error)
	FindAll(ctx context.Context, id string) ([]domain.File, error)
}

type EncryptionRepository

type EncryptionRepository interface {
	EncryptWithLocalKey(ctx context.Context, data []byte, localKey key.LocalKey) (*record.Record, error)
	EncryptWithManagedKey(ctx context.Context, data []byte, managedKey key.ManagedKey, accessControl *key.AccessControl) (*record.Record, error)
	EncryptWithManagedCertificate(ctx context.Context, data []byte, managedCertificate key.ManagedCertificate, accessControl *key.AccessControl) (*record.Record, error)
}

type IntegrityRepository

type IntegrityRepository interface {
	Certify(ctx context.Context, file []byte) (domain.Certification, error)
	CertifyFromHash(ctx context.Context, hash string, apiKey string) (domain.Certification, error)
	GetProof(ctx context.Context, hash []string, apiKey string) (domain.BloockProof, error)
}

type KeyRepository

type KeyRepository interface {
	LoadLocalKey(ctx context.Context, kty key.KeyType, key string) (*key.LocalKey, error)
	LoadManagedKey(ctx context.Context, kid string) (*key.ManagedKey, error)
	LoadLocalCertificate(ctx context.Context, pkcs12 []byte, pkcs12Password string) (*key.LocalCertificate, error)
	LoadManagedCertificate(ctx context.Context, kid string) (*key.ManagedCertificate, error)
}

type LocalStorageRepository

type LocalStorageRepository interface {
	Save(ctx context.Context, data []byte, filename string) error
	Retrieve(ctx context.Context, directory string, filename string) ([]byte, error)
}

type MerkleTreeRepository added in v1.3.0

type MerkleTreeRepository interface {
	Create(ctx context.Context, messages []domain.Message) (domain.MerkleTree, error)
}

type MessageAggregatorRepository added in v1.3.0

type MessageAggregatorRepository interface {
	SaveMessage(ctx context.Context, message domain.Message) error
	UpdateMessage(ctx context.Context, m domain.Message) error

	GetPendingMessages(ctx context.Context) ([]domain.Message, error)
	GetMessagesByRootAndAnchorID(ctx context.Context, root string, anchorID int) ([]domain.Message, error)
	GetMessagesByHashes(ctx context.Context, hash []string) ([]domain.Message, error)
	ExistRoot(ctx context.Context, root string) (bool, error)
}

type MetadataRepository

type MetadataRepository interface {
	SaveCertification(ctx context.Context, certification domain.Certification) error
	GetCertificationsByAnchorID(ctx context.Context, anchor int) (certification []domain.Certification, err error)
	FindCertificationByHash(ctx context.Context, hash string) (domain.Certification, error)
	ExistCertificationByHash(ctx context.Context, hash string) (bool, error)
	UpdateCertificationDataID(ctx context.Context, certification domain.Certification) error
	UpdateCertification(ctx context.Context, certification domain.Certification) error

	GetRecord(ctx context.Context, file []byte) (*record.Record, error)
	GetRecordDetails(ctx context.Context, file []byte) (*record.RecordDetails, error)
	GetFileHash(ctx context.Context, file []byte) (string, error)
}

type NotificationRepository

type NotificationRepository interface {
	NotifyCertification(hash string, file []byte) error
}

type ProcessRepository added in v1.3.0

type ProcessRepository interface {
	SaveProcess(ctx context.Context, process domain.Process, isAggregated bool) error
	UpdateAggregatedAnchorID(ctx context.Context, anchorID int) error
	UpdateStatusByAnchorID(ctx context.Context, anchorID int) error

	FindProcessByID(ctx context.Context, id uuid.UUID) (domain.Process, error)
	List(ctx context.Context, pq utils.PaginationQuery) ([]domain.Process, utils.Pagination, error)
}

Directories

Path Synopsis
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.

Jump to

Keyboard shortcuts

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