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: 3 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 {
	Platform string `json:"platform"`
	Username string `json:"username"`
}

type CheckOnChainDataRequest

type CheckOnChainDataRequest struct {
	CrossbellCharacterID string `json:"crossbell_character_id"`
}

type CheckOnChainDataResponse

type CheckOnChainDataResponse struct {
	IsSucceeded       bool      `json:"is_succeeded"`
	Message           string    `json:"message"`
	IsOperatorValid   bool      `json:"is_operator_valid"`
	ConnectedAccounts []Account `json:"connected_accounts"`
}
type ExtraLinks struct {
	URL         string `json:"url"`
	Type        string `json:"type"` // reply / repost / quote
	ContentHTML string `json:"content_html"`
}

type ExtraSpec

type ExtraSpec struct {
	Links []ExtraLinks `json:"links"`
}

type FeedWithExtra

type FeedWithExtra struct {
	gofeed.Feed

	Items []*ItemWithExtra `json:"items"`
}

FeedWithExtra is the universal Feed type that atom.Feed and rss.Feed gets translated to. It represents a web feed. Sorting with sort.Sort will order the Items by oldest to newest publish time.

type ItemWithExtra

type ItemWithExtra struct {
	gofeed.Item

	ID            string    `json:"id"`
	URL           string    `json:"url"`
	DatePublished time.Time `json:"date_published"`
	ContentHTML   string    `json:"content_html"`
	Extra         ExtraSpec `json:"_extra"`
}

ItemWithExtra is the universal Item type that atom.Entry and rss.Item gets translated to. It represents a single entry in a given feed.

type Media

type Media struct {
	FileName        string `json:"file_name"`
	OriginalURI     string `json:"original_uri"`
	IPFSUri         string `json:"ipfs_uri" gorm:"index;column:ipfs_uri"`
	FileSize        uint   `json:"file_size"`
	ContentType     string `json:"content_type"`
	AdditionalProps string `json:"additional_props"` // JSON-stringfied props
}

type OnChainRequest

type OnChainRequest struct {
	Platform             string `json:"platform"`
	Username             string `json:"username"`
	FeedID               uint   `json:"feed_id"` // Feed ID in main database
	CrossbellCharacterID string `json:"crossbell_character_id"`
	RawFeed
}

type OnChainResponse

type OnChainResponse struct {
	IsSucceeded bool   `json:"is_succeeded"`
	Message     string `json:"message"`
	Platform    string `json:"platform"`
	FeedID      uint   `json:"feed_id"` // Feed ID in main database
	IPFSUri     string `json:"ipfs_uri"`
	Transaction string `json:"tx"`
	CharacterID int64  `json:"character_id"`
	NoteID      int64  `json:"note_id"`
}

type RawFeed

type RawFeed struct {
	Language       string         `json:"language"`
	Title          string         `json:"title"`
	Description    string         `json:"description"`
	Content        string         `json:"text"`
	Link           string         `json:"link"`
	UpdatedAt      time.Time      `json:"updated_at"`
	PublishedAt    time.Time      `json:"published_at"`
	Authors        pq.StringArray `json:"authors" gorm:"type:text[]"`
	GUID           string         `json:"guid"`
	Image          string         `json:"image"`
	Categories     pq.StringArray `json:"categories" gorm:"type:text[]"`
	Media          []Media        `json:"media" gorm:"-"`
	ContentWarning string         `json:"content_warning"` // 'nsfw' | 'sensitive' | 'spoiler'

	RelationDeps
}

RawFeed : Minimal content of feed (just for work response)

type RelationDeps

type RelationDeps struct {
	// PostNote4Uri specified field
	ForURI         string `json:"for_uri"`
	ForCharacterID int64  `gorm:"-" json:"-"`
	ForNoteID      int64  `gorm:"-" json:"-"`
}

type ValidateRequest

type ValidateRequest struct {
	Platform             string `json:"platform"`
	Username             string `json:"username"` // The unique identifier on platform
	CrossbellCharacterID string `json:"crossbell_character_id"`
}

type ValidateResponse

type ValidateResponse struct {
	IsSucceeded            bool   `json:"is_succeeded"`
	Code                   uint   `json:"code"`
	Message                string `json:"message"`
	IsValidateStringExists bool   `json:"is_valid"`
}

type WorkDispatched

type WorkDispatched struct {
	DispatchAt time.Time `json:"dispatch_at"`
	AccountID  uint      `json:"account_id"`
	Platform   string    `json:"platform"`
	Username   string    `json:"username"`    // The unique identifier on platform
	DropBefore time.Time `json:"drop_before"` // Ignore feeds before last updated time
	DropAfter  time.Time `json:"drop_after"`  // Ignore feeds after next updated time
}

type WorkFailed

type WorkFailed struct {
	WorkDispatched

	AcceptAt    time.Time `json:"accept_at"`
	ErrorAt     time.Time `json:"error_at"`
	ErrorCode   uint      `json:"error_code"`
	ErrorReason string    `json:"error_reason"`
}

type WorkSucceeded

type WorkSucceeded struct {
	WorkDispatched

	AcceptedAt  time.Time     `json:"accepted_at"`
	SucceededAt time.Time     `json:"succeeded_at"`
	NewInterval time.Duration `json:"new_interval"`

	Feeds []RawFeed `json:"feeds"`
}

Jump to

Keyboard shortcuts

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