consts

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_DEFAULT_REDIS_CONNECTION_STRING = "redis://localhost:6379/0"
	CONFIG_DEFAULT_MQ_CONNECTION_STRING    = "amqp://guest:guest@localhost:5672/"
	CONFIG_DEFAULT_WORKER_RPC_PORT         = "22915"
)
View Source
const (
	ERROR_CODE_UNSUPPORTED_PLATFORM           = 10101 // Submit request errors
	ERROR_CODE_INVALID_FORMAT                 = 10102
	ERROR_CODE_HTTP_REQUEST_FAILED            = 10201 // Request errors
	ERROR_CODE_FAILED_TO_PARSE_FEEDS          = 10202
	ERROR_CODE_FAILED_TO_FIND_NECESSARY_FIELD = 10203
	ERROR_CODE_FAILED_TO_PARSE_JSON           = 10301 // System internal errors
	ERROR_CODE_FAILED_TO_UPLOAD               = 10401 // External system errors (like rate limit)

)
View Source
const (
	MQSETTINGS_PublishTimeOut = 5 * time.Second

	MQSETTINGS_FeedCollectDispatchQueueName   = "cos_q_feed_dispatch"
	MQSETTINGS_FeedCollectRetrieveQueueName   = "cos_q_feed_retrieve"
	MQSETTINGS_FeedCollectIdentifierField     = "cos-status-identifier"
	MQSETTINGS_FeedCollectSucceededIdentifier = "succeeded"
	MQSETTINGS_FeedCollectFailedIdentifier    = "failed"

	MQSETTINGS_ReconnectDelay = 3 * time.Second
	MQSETTINGS_ReconnectLimit = 3 // Maximum retry before process shutdown
)

`cos` means Crossbell Operator Sync

View Source
const (
	REDIS_FeedCollectResultKeyTemplate = "cos:com:%s:%s:%d" // platform : username : timestamp (work dispatched)
	REDIS_FeedCollectResultExpires     = 1 * time.Hour
)
View Source
const (
	RPCSETTINGS_BaseServiceName = "COSWorkerV2"

	RPCSETTINGS_ValidateServiceName    = "Validate" // Should be same as function name
	RPCSETTINGS_ValidateRequestTimeOut = 20 * time.Second

	RPCSETTINGS_OnChainServiceName    = "OnChain" // Should be same as function name
	RPCSETTINGS_OnChainRequestTimeOut = 3 * time.Minute

	RPCSETTINGS_CheckOnChainDataServiceName    = "CheckOnChainData" // Should be same as function name
	RPCSETTINGS_CheckOnChainDataRequestTimeOut = 20 * time.Second
)

`cos` means Crossbell Operator Sync

Variables

View Source
var SUPPORTED_PLATFORM = map[string]platform{
	"medium": {
		Name:               "Medium",
		FeedLink:           "https://medium.com/feed/@{{username}}",
		MinRefreshGap:      20 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: false,
		HTML2Markdown:      true,
		Limit1Account:      true,
	},
	"tiktok": {
		Name:               "TikTok",
		FeedLink:           "{{rsshub_stateless}}/tiktok/user/@{{username}}",
		MinRefreshGap:      30 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
	"pinterest": {
		Name:               "Pinterest",
		FeedLink:           "https://www.pinterest.com/{{username}}/feed.rss",
		MinRefreshGap:      30 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
	"twitter": {
		Name:               "Twitter",
		FeedLink:           "{{rsshub_stateless}}/twitter/user/{{username}}/excludeReplies=0&includeRts=1&showSymbolForRetweetAndReply=false.json",
		MinRefreshGap:      10 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
	"tg_channel": {
		Name:               "Telegram Channel",
		FeedLink:           "{{rsshub_stateless}}/telegram/channel/{{username}}/includeServiceMsg=0.json",
		MinRefreshGap:      30 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: false,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
	"substack": {
		Name:               "Substack",
		FeedLink:           "https://{{username}}.substack.com/feed",
		MinRefreshGap:      20 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: false,
		HTML2Markdown:      true,
		Limit1Account:      true,
	},
	"pixiv": {
		Name:               "pixiv",
		FeedLink:           "{{rsshub_stateful}}/pixiv/user/{{username}}",
		MinRefreshGap:      1 * time.Hour,
		MaxRefreshGap:      12 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
	"y2b_channel": {
		Name:               "YouTube Channel",
		FeedLink:           "https://www.youtube.com/feeds/videos.xml?channel_id={{username}}",
		MinRefreshGap:      1 * time.Hour,
		MaxRefreshGap:      12 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
	"mastodon": {
		Name:               "Mastodon",
		FeedLink:           "https://{{instance}}/@{{username}}.rss",
		MinRefreshGap:      10 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      false,
	},
	"jike": {
		Name:               "Jike",
		FeedLink:           "{{rsshub_stateless}}/jike/user/{{username}}.json",
		MinRefreshGap:      10 * time.Minute,
		MaxRefreshGap:      1 * time.Hour,
		IsMediaAttachments: true,
		HTML2Markdown:      false,
		Limit1Account:      true,
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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