core

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const Version = ""

Variables

View Source
var ErrNotFound = NewUserErrorWithStatus(404, "item not found")

Functions

func AreUserCredentialsCorrect

func AreUserCredentialsCorrect(st *state.State, email, password string) (bool, error)

func AsUserError

func AsUserError(status int, err error) error

func DeleteFeed

func DeleteFeed(st *state.State, id string) error

func ExportFeedsForUser added in v0.1.1

func ExportFeedsForUser(st *state.State, userID string) ([]byte, error)

func GenerateSessionToken

func GenerateSessionToken(userID string) string

func GetFeed

func GetFeed(st *state.State, id string) (res *db.Feed, err error)

func GetFeedsForUser

func GetFeedsForUser(st *state.State, userID string) (res []*db.Feed, err error)

func GetUserByEmail

func GetUserByEmail(st *state.State, email string) (res *db.User, err error)

func GetUserByID

func GetUserByID(st *state.State, userID string) (res *db.User, err error)

func GetUserErrorStatus

func GetUserErrorStatus(err error) int

func GetUsersBySchedule

func GetUsersBySchedule(st *state.State, day db.SendDay, hour int) (res []*db.User, err error)

func ImportFeedsForUser added in v0.1.1

func ImportFeedsForUser(st *state.State, userID string, opmlXML []byte) error

func IsUserError

func IsUserError(err error) bool

func NewFeed

func NewFeed(st *state.State, userID, name, url string) (*db.Feed, error)

func NewUserError

func NewUserError(format string, args ...any) error

func NewUserErrorWithStatus

func NewUserErrorWithStatus(status int, format string, args ...any) error

func RegisterUser

func RegisterUser(st *state.State, email, password string) (*db.User, error)

func RegisterUserOIDC added in v0.3.2

func RegisterUserOIDC(st *state.State, email string) (*db.User, error)

func UpdateFeed

func UpdateFeed(st *state.State, feed *db.Feed) error

func UpdateUser

func UpdateUser(st *state.State, user *db.User) error

func ValidateSessionToken

func ValidateSessionToken(input string) (string, time.Time, error)

Types

type UserError

type UserError struct {
	Original error
	Status   int
}

func (*UserError) Error

func (ue *UserError) Error() string

func (*UserError) Unwrap

func (ue *UserError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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