mongo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CName = "any-ns.db"

Variables

This section is empty.

Functions

func New

func New() app.Component

Types

type AAUser

type AAUser struct {
	Address         string `bson:"address"`
	AnyID           string `bson:"any_id"`
	OperationsCount uint64 `bson:"operations"`
}

TODO: index it

type AAUserOperation

type AAUserOperation struct {
	OperationID string `bson:"operation_id"`

	Data       []byte `bson:"data"`
	SignedData []byte `bson:"signed_data"`
	Context    []byte `bson:"context"`

	OwnerEthAddress string `bson:"owner_eth_address"`
	OwnerAnyID      string `bson:"owner_any_id"`
	FullName        string `bson:"full_name"`
}

see nameserviceprotoюCreateUserOperationRequest

type DbService

type DbService interface {
	AddUserToTheWhitelist(ctx context.Context, owner common.Address, ownerAnyID string, newOperations uint64) (err error)

	GetUserOperationsCount(ctx context.Context, owner common.Address, ownerAnyID string) (operations uint64, err error)
	DecreaseUserOperationsCount(ctx context.Context, owner common.Address) (err error)

	SaveOperation(ctx context.Context, opID string, cuor nsp.CreateUserOperationRequest) error
	GetOperation(ctx context.Context, opID string) (op AAUserOperation, err error)

	app.Component
}

Directories

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

Jump to

Keyboard shortcuts

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