types

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDLength    = 8
	IDStrLength = 16
)
View Source
const (
	RowIdLength    = 4
	RowIdStrLength = 8
)

Variables

This section is empty.

Functions

func IDFilter

func IDFilter(ids ...ID) [][32]byte

IDFilter fucks with go-ethereum/accounts/abi/bind/topics.go

func IDListToByteList

func IDListToByteList(ids []ID) [][8]byte

Types

type Data

type Data struct {
	UserId      ID     `json:"userId"`
	RowId       RowId  `json:"rowId"`
	CollectedAt Time   `json:"collecedAt"`
	Payload     string `json:"payload"`
}

type DataId

type DataId [20]byte

func NewDataIdFromIds

func NewDataIdFromIds(bundleId ID, accountId ID, rowId RowId) (id DataId)

func NewDataIdFromStr

func NewDataIdFromStr(dataID string) (id DataId, err error)

func (DataId) BundleId

func (id DataId) BundleId() (bundleId ID)

func (DataId) Hex

func (id DataId) Hex() string

func (DataId) RowId

func (id DataId) RowId() (rowId RowId)

func (DataId) String

func (id DataId) String() string

func (DataId) UserId

func (id DataId) UserId() (userId ID)

type EncryptedData

type EncryptedData struct {
	UserId      ID     `json:"userId"`
	RowId       RowId  `json:"rowId"`
	Capsule     []byte `json:"capsule"`
	CollectedAt Time   `json:"collectedAt"`
	Payload     []byte `json:"payload"`
}

type ID

type ID [IDLength]byte

func BytesToID

func BytesToID(idBytes []byte) ID

func GenerateID

func GenerateID(issuer common.Address, time time.Time, seed []byte) (id ID)

func HexToID

func HexToID(idStr string) (ID, error)

HexToID converts heximedical string ID (ex: deadbeef1a2b3c4d) to ID instance.

func UintToID

func UintToID(i uint64) ID

func (ID) Hex

func (id ID) Hex() string

func (ID) MarshalJSON

func (id ID) MarshalJSON() ([]byte, error)

func (ID) Uint64

func (id ID) Uint64() uint64

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(b []byte) error

type ListOption

type ListOption interface {
	// contains filtered or unexported methods
}

func ListWithFilter

func ListWithFilter(filteredFields ...string) ListOption

func ListWithPagination

func ListWithPagination(pageIndex, pageSize int) ListOption

type ListOptions

type ListOptions struct {
	// for pagination
	Limit int
	Skip  int

	Filter map[string]bool
}

func ApplyListOption

func ApplyListOption(options []ListOption) *ListOptions

type RowId

type RowId [RowIdLength]byte

func BytesToRowId

func BytesToRowId(idBytes []byte) RowId

func HexToRowId

func HexToRowId(idStr string) (RowId, error)

func UintToRowId

func UintToRowId(i uint32) RowId

func (RowId) Hex

func (id RowId) Hex() string

func (RowId) MarshalJSON

func (id RowId) MarshalJSON() ([]byte, error)

func (RowId) Uint32

func (id RowId) Uint32() uint32

func (*RowId) UnmarshalJSON

func (id *RowId) UnmarshalJSON(b []byte) error

type Time

type Time struct {
	time.Time
}

func ParseTimestamp

func ParseTimestamp(stamp int64) Time

func (Time) Timestamp

func (t Time) Timestamp() int64

Jump to

Keyboard shortcuts

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