table

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FeedSpamLimit The restriction conditions for judging the feed to be spam cannot be changed at will.
	FeedSpamLimit = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	ID         string          `gorm:"column:id"`
	Network    filter.Network  `gorm:"column:network"`
	Worker     string          `gorm:"column:worker"`
	State      json.RawMessage `gorm:"column:state;type:jsonb"`
	IndexCount int64           `gorm:"column:index_count"`
	CreatedAt  time.Time       `gorm:"column:created_at;autoCreateTime"`
	UpdatedAt  time.Time       `gorm:"column:updated_at;autoUpdateTime"`
}

func (*Checkpoint) Export

func (c *Checkpoint) Export() (*engine.Checkpoint, error)

func (*Checkpoint) Import

func (c *Checkpoint) Import(checkpoint *engine.Checkpoint) (err error)

type DatasetENSNamehash

type DatasetENSNamehash struct {
	Hash common.Hash `gorm:"column:hash;primary_key"`
	Name string      `gorm:"column:name;index:idx_ensnamehash_name"`
}

func (*DatasetENSNamehash) Export

func (d *DatasetENSNamehash) Export() (*model.ENSNamehash, error)

func (*DatasetENSNamehash) Import

func (d *DatasetENSNamehash) Import(ensNamehash *model.ENSNamehash) (err error)

type DatasetFarcasterProfile

type DatasetFarcasterProfile struct {
	Fid            int64          `gorm:"column:fid"`
	Username       string         `gorm:"column:username"`
	CustodyAddress string         `gorm:"column:custody_address"`
	EthAddresses   pq.StringArray `gorm:"column:eth_addresses;type:text[]"`
}

func (*DatasetFarcasterProfile) Export

func (d *DatasetFarcasterProfile) Export() (*model.Profile, error)

func (*DatasetFarcasterProfile) Import

func (d *DatasetFarcasterProfile) Import(profile *model.Profile) (err error)

type DatasetMirrorPost

type DatasetMirrorPost struct {
	ID                  string `gorm:"column:id;primary_key"`
	OriginContentDigest string `gorm:"column:origin_content_digest;index:idx_origin_content_digest"`
}

DatasetMirrorPost represents a mirror post for revise logic check.

func (*DatasetMirrorPost) Export

func (*DatasetMirrorPost) Import

func (p *DatasetMirrorPost) Import(post *model.DatasetMirrorPost) (err error)

type Fee

type Fee struct {
	Address *string         `json:"address,omitempty"`
	Amount  decimal.Decimal `json:"amount"`
	Decimal uint            `json:"decimal"`
}

func (*Fee) Export

func (f *Fee) Export() (*schema.Fee, error)

func (*Fee) Import

func (f *Fee) Import(fee *schema.Fee) error

func (*Fee) Scan

func (f *Fee) Scan(value any) error

func (Fee) Value

func (f Fee) Value() (driver.Value, error)

type Feed

type Feed struct {
	ID           string           `gorm:"column:id"`
	Network      filter.Network   `gorm:"column:network"`
	Platform     *filter.Platform `gorm:"column:platform"`
	Index        uint             `gorm:"column:index"`
	From         string           `gorm:"column:from"`
	To           string           `gorm:"column:to"`
	Tag          filter.Tag       `gorm:"column:tag"`
	Type         string           `gorm:"column:type"`
	Status       bool             `gorm:"column:status"`
	Fee          *Fee             `gorm:"column:fee;type:jsonb"`
	TotalActions uint             `gorm:"column:total_actions"`
	Actions      FeedActions      `gorm:"column:actions;type:jsonb"`
	Timestamp    time.Time        `gorm:"column:timestamp"`
	CreatedAt    time.Time        `gorm:"column:created_at;autoCreateTime"`
	UpdatedAt    time.Time        `gorm:"column:updated_at;autoUpdateTime"`
}

func (*Feed) Export

func (f *Feed) Export(index *Index) (*schema.Feed, error)

func (*Feed) Import

func (f *Feed) Import(feed *schema.Feed) error

func (*Feed) PartitionName

func (f *Feed) PartitionName(feed *schema.Feed) string

func (*Feed) TableName

func (f *Feed) TableName() string

type FeedAction

type FeedAction struct {
	Tag      string          `json:"tag"`
	Type     string          `json:"type"`
	From     string          `json:"from"`
	To       string          `json:"to"`
	Platform string          `json:"platform,omitempty"`
	Metadata json.RawMessage `json:"metadata"`
}

func (*FeedAction) Export

func (f *FeedAction) Export() (*schema.Action, error)

func (*FeedAction) Import

func (f *FeedAction) Import(action *schema.Action) (err error)

type FeedActions

type FeedActions []*FeedAction

func (*FeedActions) Scan

func (f *FeedActions) Scan(value any) error

func (FeedActions) Value

func (f FeedActions) Value() (driver.Value, error)

type Feeds

type Feeds []*Feed

func (*Feeds) Export

func (f *Feeds) Export(indexes []*Index) ([]*schema.Feed, error)

func (*Feeds) Import

func (f *Feeds) Import(feeds []*schema.Feed) error

type Index

type Index struct {
	ID        string           `gorm:"column:id"`
	Owner     string           `gorm:"column:owner"`
	Network   filter.Network   `gorm:"column:network"`
	Platform  *filter.Platform `gorm:"column:platform"`
	Index     uint             `gorm:"column:index"`
	Tag       filter.Tag       `gorm:"column:tag"`
	Type      string           `gorm:"column:type"`
	Status    bool             `gorm:"column:status"`
	Direction filter.Direction `gorm:"column:direction"`
	Timestamp time.Time        `gorm:"column:timestamp"`
	CreatedAt time.Time        `gorm:"column:created_at;autoCreateTime"`
	UpdatedAt time.Time        `gorm:"column:updated_at;autoUpdateTime"`
}

func (*Index) Import

func (i *Index) Import(feed *schema.Feed) error

func (*Index) PartitionName

func (i *Index) PartitionName() string

func (*Index) TableName

func (i *Index) TableName() string

type Indexes

type Indexes []*Index

func (*Indexes) Import

func (i *Indexes) Import(feed []*schema.Feed) error

Jump to

Keyboard shortcuts

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