schema

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuzzEvent

type BuzzEvent struct {
	Id         uint64              // random 64bit uint value to identify the event (Not sha256 32bytes hash)
	Pubkey     [32]byte            // encoded 256bit uint (holiman/uint256)
	Created_at int64               // unix timestamp in seconds
	Kind       uint16              // integer between 0 and 65535
	Tags       map[string][]string // Key: tag string, Value: other strings
	Content    string
	Sig        [64]byte // 64-bytes integr of the signature of the sha256 hash of the serialized event data
}

func (*BuzzEvent) GetPubkey

func (e *BuzzEvent) GetPubkey() *big.Int

func (*BuzzEvent) SetPubkey

func (e *BuzzEvent) SetPubkey(pubkey *big.Int)

type BuzzPacket

type BuzzPacket struct {
	Events []*BuzzEvent
	Req    *BuzzReq
	Resp   *BuzzResp
}

BuzzPacket is an implementation of GossipData

func NewBuzzPacket

func NewBuzzPacket(event *BuzzEvent, req *BuzzReq, resp *BuzzResp) *BuzzPacket

Construct an empty BuzzPacket object, ready to receive updates. This is suitable to use at program start. Other peers will populate us with data.

func (*BuzzPacket) Encode

func (pkt *BuzzPacket) Encode() [][]byte

Encode serializes BuzzPacket to a slice of byte-slices.

func (*BuzzPacket) Merge

func (st *BuzzPacket) Merge(other mesh.GossipData) (complete mesh.GossipData)

Merge merges the other GossipData into this one, and returns our resulting, complete BuzzPacket.

type BuzzReq

type BuzzReq struct {
}

type BuzzResp

type BuzzResp struct {
}

Jump to

Keyboard shortcuts

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