table

package
v0.4.43 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ActivitySpamLimit this limit of actions in a single activity, mark as spam if exceeds.
	ActivitySpamLimit = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Activities added in v0.4.13

type Activities []*Activity

func (*Activities) Export added in v0.4.13

func (f *Activities) Export(indexes []*Index) ([]*activityx.Activity, error)

func (*Activities) Import added in v0.4.13

func (f *Activities) Import(activities []*activityx.Activity) error

type Activity added in v0.4.13

type Activity struct {
	ID           string          `gorm:"column:id"`
	Network      network.Network `gorm:"column:network"`
	Platform     string          `gorm:"column:platform"`
	Index        uint            `gorm:"column:index"`
	From         string          `gorm:"column:from"`
	To           string          `gorm:"column:to"`
	Tag          tag.Tag         `gorm:"column:tag"`
	Type         string          `gorm:"column:type"`
	Status       bool            `gorm:"column:status"`
	Fee          *Fee            `gorm:"column:fee;type:jsonb"`
	Calldata     *Calldata       `gorm:"column:calldata;type:jsonb"`
	TotalActions uint            `gorm:"column:total_actions"`
	Actions      ActivityActions `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 (*Activity) Export added in v0.4.13

func (f *Activity) Export(index *Index) (*activityx.Activity, error)

func (*Activity) Import added in v0.4.13

func (f *Activity) Import(activity *activityx.Activity) error

func (*Activity) PartitionName added in v0.4.13

func (f *Activity) PartitionName(activity *activityx.Activity) string

func (*Activity) TableName added in v0.4.13

func (f *Activity) TableName() string

type ActivityAction added in v0.4.13

type ActivityAction 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 (*ActivityAction) Export added in v0.4.13

func (f *ActivityAction) Export() (*activityx.Action, error)

func (*ActivityAction) Import added in v0.4.13

func (f *ActivityAction) Import(action *activityx.Action) (err error)

type ActivityActions added in v0.4.13

type ActivityActions []*ActivityAction

func (*ActivityActions) Scan added in v0.4.13

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

func (ActivityActions) Value added in v0.4.13

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

type Calldata added in v0.4.19

type Calldata struct {
	Raw            string `json:"raw,omitempty"`
	FunctionHash   string `json:"function_hash,omitempty"`
	ParsedFunction string `json:"parsed_function,omitempty"`
}

func (*Calldata) Export added in v0.4.19

func (c *Calldata) Export() (*activityx.Calldata, error)

func (*Calldata) Import added in v0.4.19

func (c *Calldata) Import(calldata *activityx.Calldata) error

func (*Calldata) Scan added in v0.4.19

func (c *Calldata) Scan(value any) error

func (Calldata) Value added in v0.4.19

func (c Calldata) Value() (driver.Value, error)

type Checkpoint

type Checkpoint struct {
	ID         string          `gorm:"column:id"`
	Network    network.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() (*activityx.Fee, error)

func (*Fee) Import

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

func (*Fee) Scan

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

func (Fee) Value

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

type Index

type Index struct {
	ID        string              `gorm:"column:id"`
	Owner     string              `gorm:"column:owner"`
	Network   network.Network     `gorm:"column:network"`
	Platform  string              `gorm:"column:platform"`
	Index     uint                `gorm:"column:index"`
	Tag       tag.Tag             `gorm:"column:tag"`
	Type      string              `gorm:"column:type"`
	Status    bool                `gorm:"column:status"`
	Direction activityx.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(activity *activityx.Activity) 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(activities []*activityx.Activity) error

Jump to

Keyboard shortcuts

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