db

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPFSBlock

type IPFSBlock struct {
	gorm.Model
	CID              []byte `gorm:"type:varbinary(64);uniqueIndex;column:cid"`
	Size             uint64
	Links            []IPFSLinkedBlock `gorm:"foreignKey:ParentID"`
	LastAnnouncement *time.Time        `gorm:"index"`
	Ready            bool              `gorm:"default:false"`
}

func (IPFSBlock) TableName

func (I IPFSBlock) TableName() string

type IPFSLinkedBlock

type IPFSLinkedBlock struct {
	gorm.Model
	ParentID  uint      `gorm:"uniqueIndex:ipfs_idx_linked_blocks_unique"`
	ChildID   uint      `gorm:"uniqueIndex:ipfs_idx_linked_blocks_unique"`
	LinkIndex int       `gorm:"uniqueIndex:ipfs_idx_linked_blocks_unique"`
	Parent    IPFSBlock `gorm:"foreignKey:ParentID"`
	Child     IPFSBlock `gorm:"foreignKey:ChildID"`
}

func (IPFSLinkedBlock) TableName

func (I IPFSLinkedBlock) TableName() string

type IPFSPin

type IPFSPin struct {
	ID              uint `gorm:"primarykey"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       gorm.DeletedAt `gorm:"uniqueIndex:idx_ipfs_pin_deleted_at_pin_id,idx_ipfs_pin_hash_request_id_deleted_at"`
	Name            string         `gorm:"index"`
	PinID           uint           `gorm:"uniqueIndex:idx_ipfs_pin_deleted_at_pin_id,idx_ipfs_pin_hash_request_id_deleted_at"`
	Pin             models.Pin
	RequestID       types.BinaryUUID  `gorm:"type:binary(16);uniqueIndex:idx_ipfs_pin_hash_request_id_deleted_at"`
	ParentRequestID *types.BinaryUUID `gorm:"type:binary(16);uniqueIndex:idx_ipfs_pin_hash_request_id_deleted_at"`
	Internal        bool              `gorm:"default:false"`
	Partial         bool              `gorm:"default:false"`
}

func (IPFSPin) TableName

func (I IPFSPin) TableName() string

type IPFSPinView

type IPFSPinView struct {
	gorm.Model
	RequestID          uint                     `gorm:"column:request_id"`
	Status             models.RequestStatusType `gorm:"column:status"`
	Hash               mh.Multihash             `gorm:"column:hash;type:binary(64);"`
	HashType           uint64                   `gorm:"column:hash_type"`
	CIDType            uint64                   `gorm:"column:cid_type"`
	Name               string                   `gorm:"column:name"`
	UserID             uint                     `gorm:"column:user_id"`
	UploaderIP         string                   `gorm:"column:uploader_ip"`
	Internal           bool                     `gorm:"column:internal"`
	Partial            bool                     `gorm:"column:partial"`
	PinID              uint                     `gorm:"column:pin_id"`
	Pin                *models.Pin              `gorm:"foreignKey:PinID;references:ID"`
	PinRequestID       types.BinaryUUID         `gorm:"column:pin_request_id"`
	ParentPinRequestID *types.BinaryUUID        `gorm:"column:parent_pin_request_id"`
}

func (IPFSPinView) TableName

func (IPFSPinView) TableName() string

type IPFSRequest

type IPFSRequest struct {
	gorm.Model
	RequestID uint `gorm:"uniqueIndex:idx_ipfs_req_deleted_at_request_id"`
	Request   models.Request

	Name               string
	PinRequestID       types.BinaryUUID  `gorm:"type:binary(16);uniqueIndex:idx_ipfs_req_hash_request_id"`
	ParentPinRequestID *types.BinaryUUID `gorm:"type:binary(16);uniqueIndex:idx_ipfs_req_hash_request_id"`
	Internal           bool
}

func (IPFSRequest) TableName

func (I IPFSRequest) TableName() string

type PinningStatus

type PinningStatus string
const (
	PinningStatusQueued  PinningStatus = "queued"
	PinningStatusPinning PinningStatus = "pinning"
	PinningStatusPinned  PinningStatus = "pinned"
	PinningStatusFailed  PinningStatus = "failed"
)

type UnixFSNode

type UnixFSNode struct {
	gorm.Model
	BlockID   uint
	Block     IPFSBlock                    `gorm:"foreignKey:BlockID"`
	Name      string                       `gorm:"column:name"`
	Type      uint8                        `gorm:"column:type"`
	BlockSize int64                        `gorm:"column:block_size"`
	ChildCID  datatypes.JSONSlice[cid.Cid] `gorm:"column:child_cid"`
}

func (UnixFSNode) TableName

func (U UnixFSNode) TableName() string

Jump to

Keyboard shortcuts

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