model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EpochToTime

func EpochToTime(epoch int32) time.Time

Types

type DealID

type DealID struct {
	DealID int32 `bson:"deal_id"`
}

type DealState

type DealState struct {
	DealID     int32     `bson:"deal_id"`
	PieceCID   string    `bson:"piece_cid"`
	PieceSize  int64     `bson:"piece_size"`
	Label      string    `bson:"label"`
	Verified   bool      `bson:"verified"`
	Client     string    `bson:"client"`
	Provider   string    `bson:"provider"`
	Expiration time.Time `bson:"expiration"`
	Start      time.Time `bson:"start"`
}

func (DealState) AgeInYears

func (s DealState) AgeInYears() float64

type Protocol

type Protocol struct {
	// The name of the transport protocol eg "libp2p" or "http"
	Name string
	// The address of the endpoint in multiaddr format
	Addresses []abi.Multiaddrs
}

func (*Protocol) MarshalCBOR

func (t *Protocol) MarshalCBOR(w io.Writer) error

func (*Protocol) UnmarshalCBOR

func (t *Protocol) UnmarshalCBOR(r io.Reader) (err error)

type ProtocolName

type ProtocolName string
const (
	GraphSync ProtocolName = "GraphSync"
	Bitswap   ProtocolName = "bitswap"
	HTTP      ProtocolName = "http"
	HTTPS     ProtocolName = "https"
	Libp2p    ProtocolName = "libp2p"
	WS        ProtocolName = "ws"
	WSS       ProtocolName = "wss"
)

type QueryResponse

type QueryResponse struct {
	Protocols []Protocol
}

func (*QueryResponse) MarshalCBOR

func (t *QueryResponse) MarshalCBOR(w io.Writer) error

func (*QueryResponse) UnmarshalCBOR

func (t *QueryResponse) UnmarshalCBOR(r io.Reader) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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