feed

package
v0.0.0-...-3bd2bae Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Country

func Country(s string) func(*ListOpts)

func Create

func Create(ctx context.Context, mg *db.MongoDB, feed *feedsv2.Feed) (*feedsv2.Feed, error)

Create creates a new feed.

func Delete

func Delete(ctx context.Context, mg *db.MongoDB, feed *feedsv2.Feed) error

Delete deletes a feed.

func EnsureIndex

func EnsureIndex(ctx context.Context, dbConn *db.MongoDB) error

EnsureIndex in mongodb.

func Get

func Get(ctx context.Context, mg *db.MongoDB, optionsList ...func(*ListOpts)) (*feedsv2.Feed, error)

Get returns a single feed by feed query.

func GetByHostname

func GetByHostname(ctx context.Context, mg *db.MongoDB, hostname string) (*feedsv2.Feed, error)

GetByHostname returns a feed with a specific hostname.

func GetByUserName

func GetByUserName(ctx context.Context, mg *db.MongoDB, username string) (*feedsv2.Feed, error)

GetByUserName returns a feed with a specific user_name.

func GetFeedsStreamList

func GetFeedsStreamList(ctx context.Context, mg *db.MongoDB, optionsList ...func(*ListOpts)) ([]*feedsv2.Feed, error)

GetFeedsStreamList returns a list of all active streams by feed query.

func Hostname

func Hostname(i string) func(*ListOpts)

func Id

func Id(i string) func(*ListOpts)

func Lang

func Lang(s string) func(*ListOpts)

func Limit

func Limit(i int) func(*ListOpts)

func List

func List(ctx context.Context, mg *db.MongoDB, optionsList ...func(*ListOpts)) (*feedsv2.FeedList, error)

List returns a list of feeds by feed query.

func NewListOpts

func NewListOpts() []func(*ListOpts)

func Offset

func Offset(i int) func(*ListOpts)

func Q

func Q(i string) func(*ListOpts)

func SortKey

func SortKey(i string) func(*ListOpts)

func SortOrder

func SortOrder(s int) func(*ListOpts)

func StreamStatus

func StreamStatus(s int) func(*ListOpts)

func StreamType

func StreamType(s int) func(*ListOpts)

func Update

func Update(ctx context.Context, mg *db.MongoDB, feed *feedsv2.Feed) error

Update updates a feed.

func UserName

func UserName(i string) func(*ListOpts)

Types

type ListOpts

type ListOpts struct {
	Limit        int
	Offset       int
	Id           string
	Q            string
	UserName     string
	Hostname     string
	StreamStatus int
	StreamType   int
	Lang         string
	Country      string
	SortKey      string
	SortOrder    int
}

ListOpts implements feed's list options stuct.

func DefaultOpts

func DefaultOpts() ListOpts

Jump to

Keyboard shortcuts

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