processing

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

Documentation

Index

Constants

View Source
const (
	StatusFailed     Status = 0
	StatusSuccess    Status = 1
	StatusPending    Status = 2
	StatusProcessing Status = 3
	StatusUnknown    Status = 255

	TxUnknown TxKind = iota
	TxMultiCall
	TxSetEhrUser
	TxSetEhrBySubject
	TxSetEhrDocs
	TxSetDocAccess
	TxSetDocGroupAccess
	TxSetUserGroupAccess
	TxDeleteDoc
	TxFilecoinStartDeal
	TxEhrCreateWithID
	TxUpdateEhrStatus
	TxAddEhrDoc
	TxSetDocKeyEncrypted
	TxSaveEhr
	TxSaveEhrStatus
	TxSaveComposition
	TxSaveTemplate
	TxUserRegister
	TxUserNew
	TxUserGroupCreate
	TxUserGroupAddUser
	TxUserGroupRemoveUser
	TxDocGroupCreate
	TxDocGroupAddDoc
	TxIndexDataUpdate
	TxCreateDirectory
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockChainService

type BlockChainService uint8

type DocResult

type DocResult struct {
	Kind         string `json:"kind"`
	CID          string `json:"cid"`
	DealCID      string `json:"dealCid"`
	MinerAddress string `json:"minerAddress"`
}

type EthereumTx

type EthereumTx struct {
	Tx
	Hash string
}

type FileCoinTx

type FileCoinTx struct {
	Tx
	CID          string
	DealCID      string
	MinerAddress string
	DealID       uint
}

type Proc

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

func New

func New(db *gorm.DB, ethClient *ethclient.Client, filecoinClient *filecoin.Client, ipfsClient *ipfs.Client, storagePath string) *Proc

func (*Proc) AddRetrieve

func (p *Proc) AddRetrieve(CID string) error

func (*Proc) GetRequest

func (p *Proc) GetRequest(userID, reqID string) ([]byte, error)

func (*Proc) GetRequests

func (p *Proc) GetRequests(userID string, limit, offset int) ([]byte, error)

func (*Proc) GetRequestsByKindInProgress

func (p *Proc) GetRequestsByKindInProgress(userID string, kind RequestKind) (RequestsResult, error)

func (*Proc) GetRetrieveStatus

func (p *Proc) GetRetrieveStatus(CID *cid.Cid) (Status, error)

func (*Proc) NewRequest

func (p *Proc) NewRequest(reqID, userID, ehrUUID string, kind RequestKind) (*Request, error)

func (*Proc) Start

func (p *Proc) Start()

func (*Proc) Stop

func (p *Proc) Stop()

type Request

type Request struct {
	gorm.Model
	ReqID     string      `gorm:"index:idx_request,unique"`
	Kind      RequestKind `gorm:"kind" json:"-"`
	KindStr   string      `gorm:"-" json:"Kind"`
	Status    Status      `gorm:"status" json:"-"`
	StatusStr string      `gorm:"-" json:"Status"`
	UserID    string
	EhrUUID   string
	// contains filtered or unexported fields
}

func (*Request) AddEthereumTx

func (r *Request) AddEthereumTx(kind TxKind, hash string)

func (*Request) AddFilecoinTx

func (r *Request) AddFilecoinTx(kind TxKind, CID, dealCID, minerAddress string)

func (*Request) Commit

func (r *Request) Commit() error

type RequestInterface

type RequestInterface interface {
	Commit() error
	AddEthereumTx(TxKind, string)
	AddFilecoinTx(TxKind, string, string, string)
}

type RequestKind

type RequestKind uint8
const (
	RequestUnknown RequestKind = iota
	RequestEhrCreate
	RequestEhrCreateWithID
	RequestEhrGetBySubject
	RequestEhrGetByID
	RequestEhrStatusCreate
	RequestEhrStatusUpdate
	RequestEhrStatusGetByID
	RequestEhrStatusGetByTime
	RequestCompositionCreate
	RequestCompositionUpdate
	RequestCompositionGetByID
	RequestCompositionDelete
	RequestUserRegister
	RequestDocAccessSet
	RequestQueryStore
	RequestUserGroupCreate
	RequestUserGroupAddUser
	RequestUserGroupRemoveUser
	RequestContributionCreate
	RequestTemplateCreate
	RequestDirectoryCreate
	RequestDirectoryUpdate
	RequestDirectoryDelete
)

func (RequestKind) String

func (k RequestKind) String() string

type RequestResult

type RequestResult struct {
	Status   string        `json:"status"`
	Kind     string        `json:"kind"`
	Ethereum []*EthereumTx `json:"ethereum"`
	Filecoin []*FileCoinTx `json:"filecoin"`
}

type RequestsCriteria

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

func (*RequestsCriteria) ByKind

func (rc *RequestsCriteria) ByKind(kind []RequestKind)

func (*RequestsCriteria) ByStatus

func (rc *RequestsCriteria) ByStatus(status []Status)

type RequestsResult

type RequestsResult map[string]*RequestResult

type Retrieve

type Retrieve struct {
	CID     string `gorm:"primaryKey"`
	DealID  retrievalmarket.DealID
	Status  Status
	Comment string
}

type Status

type Status uint8

func (Status) String

func (s Status) String() string

type Tx

type Tx struct {
	ReqID     string `gorm:"req_id" json:"-"`
	Kind      TxKind `gorm:"kind" json:"-"`
	KindStr   string `gorm:"-" json:"Kind"`
	Status    Status `gorm:"status" json:"-"`
	StatusStr string `gorm:"-" json:"Status"`
	Comment   string
}

type TxKind

type TxKind uint8

func (TxKind) String

func (k TxKind) String() string

type TxResult

type TxResult struct {
	Kind       string `json:"kind"`
	Status     string `json:"status"`
	Hash       string `json:"hash"`
	ParentHash string `json:"parentHash"`
}

Jump to

Keyboard shortcuts

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