models

package
v0.0.0-...-674c92d Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IPNSRecordVisitTableName   = "ipns_record_visits"
	IPNSRecordVisitBatcherSize = 4096
)
View Source
var (
	PeerInfoVisitTableName   = "peer_info_visits"
	PeerInfoVisitBatcherSize = getPeerInfoBatchSize()
)
View Source
var (
	SampleGenericVisitTableName   = "generic_visits"
	SampleGenericVisitBatcherSize = SamplingitemBatcherSize * 4
)
View Source
var (
	SampleValueVisitTableName   = "value_visits"
	SampleValueVisitBatcherSize = SamplingitemBatcherSize * 4
)
View Source
var (
	SamplingItemTableName   = "items"
	SamplingitemBatcherSize = 1024
)
View Source
var (
	BlockTableName = "blocks"
)

Functions

This section is empty.

Types

type Block

type Block struct {
	Timestamp   time.Time `ch:"timestamp" json:"timestamp"`
	Network     string    `ch:"network" json:"network"`
	Number      uint64    `ch:"number" json:"number"`
	Hash        string    `ch:"hash" json:"hash"`
	Key         string    `ch:"key" json:"key"`
	Metadata    string    `ch:"metadata" json:"metadata"`
	DASRows     uint32    `ch:"das_rows" json:"das_rows"`
	DASColumns  uint32    `ch:"das_columns" json:"das_columns"`
	SampleUntil time.Time `ch:"sample_until" json:"sample_until"`
}

func (Block) BatchingSize

func (b Block) BatchingSize() int

func (Block) IsComplete

func (b Block) IsComplete() bool

func (Block) QueryValues

func (b Block) QueryValues() map[string]any

func (Block) TableName

func (b Block) TableName() string

type GeneralVisit

type GeneralVisit struct {
	GenericVisit           []*SampleGenericVisit
	GenericValueVisit      []*SampleValueVisit
	GenericPeerInfoVisit   []*PeerInfoVisit
	GenericIPNSRecordVisit []*IPNSRecordVisit
}

func (*GeneralVisit) GetGenericIPNSRecordVisit

func (v *GeneralVisit) GetGenericIPNSRecordVisit() []*IPNSRecordVisit

func (*GeneralVisit) GetGenericPeerInfoVisit

func (v *GeneralVisit) GetGenericPeerInfoVisit() []*PeerInfoVisit

func (*GeneralVisit) GetGenericValueVisit

func (v *GeneralVisit) GetGenericValueVisit() []*SampleValueVisit

func (*GeneralVisit) GetGenericVisit

func (v *GeneralVisit) GetGenericVisit() []*SampleGenericVisit

type IPNSRecordVisit

type IPNSRecordVisit struct {
	VisitRound    uint64        `ch:"visit_round" json:"visit_round"` // Round number of the crawling visit
	Timestamp     time.Time     `ch:"timestamp" json:"timestamp"`     // When the peer was visited
	Record        string        `ch:"record" json:"record"`           // Unique identifier of the IPNS record
	RecordType    string        `ch:"record_type" json:"record_type"` // Type of IPNS record (e.g., "ipns-record", "dns-link")
	Quorum        uint8         `ch:"quorum" json:"quorum"`           // Quorum target for the DHT lookup
	SeqNumber     uint32        `ch:"seq_number" json:"seq_number"`   // The highest found version for the ipns record
	TTL           time.Duration `ch:"ttl" json:"ttl"`
	IsValid       bool          `ch:"is_valid" json:"is_valid"`
	IsRetrievable bool          `ch:"is_retrievable" json:"is_retrievable"` // Whether the item was retrievable or not from the Network
	Result        string        `ch:"result" json:"result"`                 // Resulting CID/Link representation
	Duration      time.Duration `ch:"duration" json:"duration"`             // Time taken to establish connection/gather info
	Error         string        `ch:"error" json:"error"`                   // Error message if visit failed
}

func (IPNSRecordVisit) BatchingSize

func (p IPNSRecordVisit) BatchingSize() int

func (IPNSRecordVisit) IsComplete

func (p IPNSRecordVisit) IsComplete() bool

func (IPNSRecordVisit) QueryValues

func (p IPNSRecordVisit) QueryValues() map[string]any

func (IPNSRecordVisit) TableName

func (p IPNSRecordVisit) TableName() string

type PeerInfoVisit

type PeerInfoVisit struct {
	VisitRound      uint64                `ch:"visit_round" json:"visit_round"`         // Round number of the crawling visit
	Timestamp       time.Time             `ch:"timestamp" json:"timestamp"`             // When the peer was visited
	Network         string                `ch:"network" json:"network"`                 // Network identifier (e.g., "ipfs", "libp2p")
	PeerID          string                `ch:"peerID" json:"peerID"`                   // Unique identifier of the peer
	Duration        time.Duration         `ch:"duration" json:"duration"`               // Time taken to establish connection/gather info
	AgentVersion    string                `ch:"agentVersion" json:"agentVersion"`       // Software version reported by the peer
	Protocols       []protocol.ID         `ch:"protocols" json:"protocols"`             // List of protocols supported by the peer
	ProtocolVersion string                `ch:"protocolVersion" json:"protocolVersion"` // Version of the main protocol
	MultiAddresses  []multiaddr.Multiaddr `ch:"multiAddresses" json:"multiAddresses"`   // Network addresses where peer can be reached
	Error           string                `ch:"error" json:"error"`                     // Error message if visit failed
}

func (PeerInfoVisit) BatchingSize

func (p PeerInfoVisit) BatchingSize() int

func (PeerInfoVisit) IsComplete

func (p PeerInfoVisit) IsComplete() bool

func (PeerInfoVisit) QueryValues

func (p PeerInfoVisit) QueryValues() map[string]any

func (PeerInfoVisit) TableName

func (p PeerInfoVisit) TableName() string

type SampleGenericVisit

type SampleGenericVisit struct {
	VisitType     string    `ch:"visit_type" json:"visit_type"`
	VisitRound    uint64    `ch:"visit_round" json:"visit_round"`
	Network       string    `ch:"network" json:"network"`
	Timestamp     time.Time `ch:"timestamp" json:"timestamp"`
	Key           string    `ch:"key" json:"key"`
	DurationMs    int64     `ch:"duration_ms" json:"duration_ms"`
	ResponseItems int32     `ch:"response_items" json:"response_items"`
	Peers         []string  `ch:"peer_ids" json:"peer_ids"`
	Error         string    `ch:"error" json:"error"`
}

func (SampleGenericVisit) BatchingSize

func (b SampleGenericVisit) BatchingSize() int

func (SampleGenericVisit) IsComplete

func (b SampleGenericVisit) IsComplete() bool

func (SampleGenericVisit) QueryValues

func (b SampleGenericVisit) QueryValues() map[string]any

func (SampleGenericVisit) TableName

func (b SampleGenericVisit) TableName() string

type SampleValueVisit

type SampleValueVisit struct {
	VisitType     string    `ch:"visit_type" json:"visit_type"`
	VisitRound    uint64    `ch:"visit_round" json:"visit_round"`
	Network       string    `ch:"network" json:"network"`
	Timestamp     time.Time `ch:"timestamp" json:"timestamp"`
	Key           string    `ch:"key" json:"key"`
	BlockNumber   uint64    `ch:"block_number" json:"block_number"`
	DASRow        uint32    `ch:"das_row" json:"rdas_row"`
	DASColumn     uint32    `ch:"das_column" json:"das_column"`
	DurationMs    int64     `ch:"duration_ms" json:"duration_ms"`
	IsRetrievable bool      `ch:"is_retrievable" json:"is_retrievable"`
	Bytes         int32     `ch:"bytes" json:"bytes"`
	Error         string    `ch:"error" json:"error"`
}

func (SampleValueVisit) BatchingSize

func (b SampleValueVisit) BatchingSize() int

func (SampleValueVisit) IsComplete

func (b SampleValueVisit) IsComplete() bool

func (SampleValueVisit) QueryValues

func (b SampleValueVisit) QueryValues() map[string]any

func (SampleValueVisit) TableName

func (b SampleValueVisit) TableName() string

type SamplingItem

type SamplingItem struct {
	Timestamp   time.Time `ch:"timestamp" json:"timestamp"`
	Network     string    `ch:"network" json:"network"`
	ItemType    string    `ch:"item_type" json:"item_type"`
	SampleType  string    `ch:"sample_type" json:"sample_type"`
	BlockLink   uint64    `ch:"block_link" json:"block_link"`
	Key         string    `ch:"key" json:"key"`
	Hash        string    `ch:"hash" json:"hash"`
	DASRow      uint32    `ch:"das_row" json:"das_row"`
	DASColumn   uint32    `ch:"das_column" json:"das_column"`
	Metadata    string    `ch:"metadata" json:"metadata"`
	Traceable   bool      `ch:"traceable" json:"traceable"`
	SampleUntil time.Time `ch:"sample_until" json:"sample_until"`
	NextVisit   time.Time // internal for the ItemSet
}

func (SamplingItem) BatchingSize

func (s SamplingItem) BatchingSize() int

func (SamplingItem) IsComplete

func (s SamplingItem) IsComplete() bool

func (SamplingItem) IsFinished

func (s SamplingItem) IsFinished() bool

func (SamplingItem) IsReadyForNextPing

func (s SamplingItem) IsReadyForNextPing() bool

func (SamplingItem) QueryValues

func (s SamplingItem) QueryValues() map[string]any

func (SamplingItem) TableName

func (s SamplingItem) TableName() string

Jump to

Keyboard shortcuts

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