rssfeeder

package module
v0.0.0-...-22dea01 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: MIT Imports: 2 Imported by: 0

README

Build Status Go Report Card

rssfeeder

A client / server app for providing rss feeds written in go.

Overview

This project consists of two separate applications, a server and a client.

The client can add feed entries in different feeds on the server. Each feed can be retrieved as atom or rss feed or as a simple json list. The data is stored in a bolt db file.

Usage

To use these applications a server is needed and a client that can access the server.

Server

To start the server you can use the docker-compose file. Make sure to replace at lease the user credentials and the secret. The secret is used for signing the JWTs.

The data is stored in a single file. If loosing the data is not option make sure to use a mounted volume.

The following ENV variables are available:

ENV variable Description Example Values
LOG_DEBUG print debug level log messages 1
LOG_VERBOSE print info level log messages 1
DB Path where the db file will be stored. /data
PORT Port to listen for requests 3000
HOST Hostname of the service http://rssfeeder.com:3000
SECRET Secret string used to sign JWT someSecret
SESSION_TTL Time after a user has to relogin 24h
CREATE_USER Create a user on startup. Needs LOGIN and PASSWORD 1
LOGIN Login of the user to create on startup martin
PASSWORD Password of the user to create on startup martin

Client

Documentation

Index

Constants

View Source
const DefaultFeedName = "default"

DefaultFeedName is the default name of a feed where entries are stored

Variables

View Source
var (
	ErrEmptyLogin   = errors.New("empty login")
	ErrEmptyURI     = errors.New("uri is empty")
	ErrNotAllowed   = errors.New("not allowed")
	ErrEntryMissing = errors.New("entry does not exist")
	ErrFeedMissing  = errors.New("feed does not exist")
)

Functions

This section is empty.

Types

type AddingService

type AddingService interface {
	AddFeedEntry(entry *FeedEntry) error
}

type DeletingService

type DeletingService interface {
	DeleteFeed(id int, login string) error
	DeleteFeedEntry(id int, login string) error
}

type Feed

type Feed struct {
	ID    int
	Name  string
	Token string
	Login string
}

Feed represents a RSS feed

type FeedEntry

type FeedEntry struct {
	ID         int
	Login      string
	FeedName   string
	URI        string
	CreateDate time.Time
}

FeedEntry represents a single item in a RSS feed

type FeedEntryStorage

type FeedEntryStorage interface {
	Add(entry *FeedEntry) error
	Delete(id int) error
	AllByLoginAndFeedName(login string, feedName string) ([]*FeedEntry, error)
	ExistsEntry(id int) (bool, error)
	EntryBelongsToLogin(id int, login string) (bool, error)
}

FeedEntryStorage manages persistence of feed entries

type FeedStorage

type FeedStorage interface {
	Add(feed *Feed) error
	Get(id int) (*Feed, error)
	Exists(login, name string) (bool, error)
	GetByNameAndLogin(login, name string) (*Feed, error)
	Delete(id int) error
	GetFeedsByLogin(login string) ([]*Feed, error)
}

FeedStorage manages persistence of a RSS feed

type User

type User struct {
	ID       int
	Login    string
	Password string
}

type UserStorage

type UserStorage interface {
	Add(user *User) error
	Update(user *User) error
	Delete(login string) error
	Get(login string) (*User, error)
}

type ViewingService

type ViewingService interface {
	GetFeeds(login string) ([]*Feed, error)
	GetFeed(feedName string, login string) ([]*FeedEntry, error)
}

Directories

Path Synopsis
cmd
pkg
rest
this package contains structs for client and server communication
this package contains structs for client and server communication
server/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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