picker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_DURATION time.Duration = time.Hour * 24 * 14

Functions

func BuildID

func BuildID(t *time.Time) string

Types

type BaseHandler

type BaseHandler struct {
	DB         *sqlx.DB
	SiteConfig *config.SiteConfig
}

func (*BaseHandler) ReadLastRunTime

func (h *BaseHandler) ReadLastRunTime(dur *time.Duration) (*time.Time, error)

func (*BaseHandler) SaveLastRunTime

func (h *BaseHandler) SaveLastRunTime(t time.Time, src int) error

type BlogHandler

type BlogHandler struct {
	BaseHandler
}

func (*BlogHandler) Pick

func (h *BlogHandler) Pick() error

type FeedPicker

type FeedPicker interface {
	Pick() error
}

RecipeScraper インターフェースを定義

func PickerFactory

func PickerFactory(db *sqlx.DB, src *config.SiteConfig) (FeedPicker, error)

type MastodonHandler

type MastodonHandler struct {
	BaseHandler
}

func (MastodonHandler) Fetch

func (*MastodonHandler) Pick

func (h *MastodonHandler) Pick() error

type MastodonUserStatusAPIResponse

type MastodonUserStatusAPIResponse struct {
	Id        string `json:"id"`
	Sensitive bool   `json:"sensitive"`
	CreatedAt string `json:"created_at"`
	Url       string `json:"url"`
	Content   string `json:"content"`
}

type MisskeyAPIRequestPayload

type MisskeyAPIRequestPayload struct {
	UserId       string `json:"userId"`
	WithReplies  bool   `json:"withReplies"`
	WithRenotes  bool   `json:"withRenotes"`
	UntilDate    int64  `json:"untilDate"`
	AllowPartial bool   `json:"allowPartial"`
}

type MisskeyAPIResponsePayload

type MisskeyAPIResponsePayload struct {
	Id             string  `json:"id"`
	CreatedAt      string  `json:"createdAt"`
	Text           string  `json:"text"`
	ContentWarning *string `json:"cw"`
}

type MisskeyHandler

type MisskeyHandler struct {
	BaseHandler
}

func (*MisskeyHandler) Fetch

func (h *MisskeyHandler) Fetch(reqUrl *url.URL, lastRun *time.Time) (*[]MisskeyAPIResponsePayload, error)

func (*MisskeyHandler) Pick

func (h *MisskeyHandler) Pick() error

type ScrapboxHandler

type ScrapboxHandler struct {
	BaseHandler
}

func (*ScrapboxHandler) Pick

func (h *ScrapboxHandler) Pick() error

type Source

type Source struct {
	Id        int    `db:"id"`
	SourceUrl string `db:"source_url"`
	SiteUrl   string `db:"site_url"`
	Type      int    `db:"type"`
}

Jump to

Keyboard shortcuts

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