persistence

package
v0.13.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

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

func New

func New(db *pebble.DB, beginningBlockNumber uint64, chainEndpoint, ioIDRegistryEndpoint string, clientContractAddr, didContractAddr common.Address) (*Contract, error)

func (*Contract) DIDDoc

func (c *Contract) DIDDoc(did string) ([]byte, error)

func (*Contract) IsApproved

func (c *Contract) IsApproved(projectID uint64, clientAddr common.Address) (bool, error)

type Message

type Message struct {
	gorm.Model
	MessageID      string `gorm:"index:message_id,not null"`
	ClientID       string `gorm:"index:message_fetch,not null,default:''"`
	ProjectID      uint64 `gorm:"index:message_fetch,not null"`
	ProjectVersion string `gorm:"index:message_fetch,not null,default:'0.0'"`
	Data           []byte `gorm:"size:4096"`
	InternalTaskID string `gorm:"index:internal_task_id,not null,default:''"`
}

type Persistence

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

func NewPersistence

func NewPersistence(pgEndpoint string) (*Persistence, error)

func (*Persistence) FetchMessage

func (p *Persistence) FetchMessage(messageID string) ([]*Message, error)

func (*Persistence) FetchTask

func (p *Persistence) FetchTask(internalTaskID string) ([]*Task, error)

func (*Persistence) Save

func (p *Persistence) Save(msg *Message, aggregationAmount uint, sk *ecdsa.PrivateKey) error

type Task

type Task struct {
	gorm.Model
	ProjectID      uint64         `gorm:"index:task_fetch,not null"`
	InternalTaskID string         `gorm:"index:internal_task_id,not null"`
	MessageIDs     datatypes.JSON `gorm:"not null"`
	Signature      string         `gorm:"not null,default:''"`
}

Jump to

Keyboard shortcuts

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