feeds

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

README

go-activitypub-feeds

An opinionated Go package for publishing syndication feeds to ActivityPub accounts.

This code might still be merged into sfomuseum/go-activitypub.

Documentation

Documentation is incomplete at this time. For now have a look at app/feeds/publish/publish.go.

See also

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeedsPublicationLogsDatabaseSchemes

func FeedsPublicationLogsDatabaseSchemes() []string

Schemes returns the list of schemes that have been registered.

func RegisterFeedsPublicationLogsDatabase

func RegisterFeedsPublicationLogsDatabase(ctx context.Context, scheme string, init_func FeedsPublicationLogsDatabaseInitializationFunc) error

RegisterFeedsPublicationLogsDatabase registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `FeedsPublicationLogsDatabase` instances by the `NewFeedsPublicationLogsDatabase` method.

Types

type DocstoreFeedsPublicationLogsDatabase

type DocstoreFeedsPublicationLogsDatabase struct {
	FeedsPublicationLogsDatabase
	// contains filtered or unexported fields
}

func (*DocstoreFeedsPublicationLogsDatabase) AddPublicationLog

func (db *DocstoreFeedsPublicationLogsDatabase) AddPublicationLog(ctx context.Context, log *PublicationLog) error

func (*DocstoreFeedsPublicationLogsDatabase) Close

func (*DocstoreFeedsPublicationLogsDatabase) IsPublished

func (db *DocstoreFeedsPublicationLogsDatabase) IsPublished(ctx context.Context, account_id int64, feed_url string, item_guid string) (bool, error)

type FeedsPublicationLogsDatabase

type FeedsPublicationLogsDatabase interface {
	IsPublished(context.Context, int64, string, string) (bool, error)
	AddPublicationLog(context.Context, *PublicationLog) error
	Close(context.Context) error
}

func NewDocstoreFeedsPublicationLogsDatabase

func NewDocstoreFeedsPublicationLogsDatabase(ctx context.Context, uri string) (FeedsPublicationLogsDatabase, error)

func NewFeedsPublicationLogsDatabase

func NewFeedsPublicationLogsDatabase(ctx context.Context, uri string) (FeedsPublicationLogsDatabase, error)

NewFeedsPublicationLogsDatabase returns a new `FeedsPublicationLogsDatabase` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `FeedsPublicationLogsDatabaseInitializationFunc` function used to instantiate the new `FeedsPublicationLogsDatabase`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterFeedsPublicationLogsDatabase` method.

func NewNullFeedsPublicationLogsDatabase

func NewNullFeedsPublicationLogsDatabase(ctx context.Context, uri string) (FeedsPublicationLogsDatabase, error)

type FeedsPublicationLogsDatabaseInitializationFunc

type FeedsPublicationLogsDatabaseInitializationFunc func(ctx context.Context, uri string) (FeedsPublicationLogsDatabase, error)

FeedsPublicationLogsDatabaseInitializationFunc is a function defined by individual feeds_publication_logs_database package and used to create an instance of that feeds_publication_logs_database

type NullFeedsPublicationLogsDatabase

type NullFeedsPublicationLogsDatabase struct {
	FeedsPublicationLogsDatabase
}

func (*NullFeedsPublicationLogsDatabase) AddPublicationLog

func (db *NullFeedsPublicationLogsDatabase) AddPublicationLog(ctx context.Context, log *PublicationLog) error

func (*NullFeedsPublicationLogsDatabase) Close

func (*NullFeedsPublicationLogsDatabase) IsPublished

func (db *NullFeedsPublicationLogsDatabase) IsPublished(ctx context.Context, account_id int64, feed_url string, item_guid string) (bool, error)

type PublicationLog

type PublicationLog struct {
	Id        int64  `json:"id"`
	AccountId int64  `json:"account_id"`
	FeedURL   string `json:"feed_url"`
	ItemGUID  string `json:"item_guid"`
	Published int64  `json:"published"`
}

func NewPublicationLog

func NewPublicationLog(ctx context.Context, account_id int64, feed_url string, item_guid string) (*PublicationLog, error)

Directories

Path Synopsis
app
cmd
schema
templates

Jump to

Keyboard shortcuts

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