types

package
v0.0.0-...-e0ac650 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// Structure related
	CrossbellCharacterID string `json:"crossbell_character_id" gorm:"index;column:crossbell_character_id"`

	// Metadata
	Platform string `json:"platform" gorm:"index"` // Platform ID
	Username string `json:"username" gorm:"index"`

	// Update related fields
	LastUpdated    time.Time     `json:"last_updated"`             // Only update when new data found
	UpdateInterval time.Duration `json:"update_interval"`          // UpdateInterval = [min, (NextUpdate - LastUpdated), max]
	NextUpdate     time.Time     `json:"next_update" gorm:"index"` // NextUpdate += UpdateInterval

	FeedsCount uint                 `json:"feeds_count"` // Recorded feeds
	NotesCount uint                 `json:"notes_count"` // On-Chain notes
	MediaUsage MediaTypeRecordArray `gorm:"type:text" json:"media_usage"`
}

type AccountMetrics

type AccountMetrics struct {
	Total int64 `json:"total"`
	Valid int64 `json:"valid"` // With at least one feed
}

type AccountWithAdditionalPropsForListResponse

type AccountWithAdditionalPropsForListResponse struct {
	Account
	OnChainStatusManageForAccount

	IsMetadataCorrect bool `json:"is_metadata_correct"`
}

type Character

type Character struct {
	// Structure related
	CrossbellCharacterID string `json:"crossbell_character_id" gorm:"primarykey;column:crossbell_character_id"`
}

type Feed

type Feed struct {
	// Structure related
	AccountID uint `json:"-" gorm:"index"`

	// Feed Metadata
	Platform    string    `json:"platform" gorm:"-"` // For table splitting
	CollectedAt time.Time `json:"collected_at"`

	// Related Media
	MediaIPFSUris pq.StringArray `json:"media_ipfs_uris" gorm:"type:text[];column:media_ipfs_uris"`

	// Raw feed
	commonTypes.RawFeed
}

type MediaTypeRecord

type MediaTypeRecord struct {
	ContentType string `json:"content_type"`
	Usage       uint   `json:"usage"`
}

type MediaTypeRecordArray

type MediaTypeRecordArray []MediaTypeRecord

func (*MediaTypeRecordArray) Scan

func (ma *MediaTypeRecordArray) Scan(src interface{}) error

func (MediaTypeRecordArray) Value

func (ma MediaTypeRecordArray) Value() (driver.Value, error)

type Metrics

type Metrics struct {
	GeneratedAt time.Time `json:"generated_at"`
	//Address     struct {
	//	Total int64 `json:"total"` // How many unique addresses for characters
	//} `json:"address"`
	Character struct {
		Total int64 `json:"total"`
		Valid int64 `json:"valid"` // With at least one account
	} `json:"character"`
	Account  AccountMetrics             `json:"account"`
	Platform map[string]PlatformMetrics `json:"platform"`
}

type OnChainData

type OnChainData struct {
	IPFSUri     string `json:"ipfs_uri" gorm:"column:ipfs_uri"`
	Transaction string `json:"transaction" gorm:"index"` // Query for unpublished feeds
	CharacterID int64
	NoteID      int64
}

type OnChainStatusManageForAccount

type OnChainStatusManageForAccount struct {
	IsOnChainPaused     bool      `json:"is_onchain_paused" gorm:"index;column:is_onchain_paused"`
	OnChainPausedAt     time.Time `json:"onChain_paused_at"`
	OnChainPauseMessage string    `json:"onChain_pause_message"`
}

type PlatformMetrics

type PlatformMetrics struct {
	Feed    int64          `json:"feed"`
	Account AccountMetrics `json:"account"`
}

type Pool

type Pool struct {
	Addr string
	// contains filtered or unexported fields
}

func NewPool

func NewPool(addr string, dialNow bool) *Pool

func (*Pool) Call

func (p *Pool) Call(serviceMethod string, args interface{}, reply interface{}) error

func (*Pool) Close

func (p *Pool) Close() error

Jump to

Keyboard shortcuts

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