storage

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package storage provides a persistent storage for feed data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChannel

func CreateChannel(channelID, feedID int64, name string)

func CreateFeed

func CreateFeed(channelID int64, name string)

func DeleteChannel

func DeleteChannel(id int64) bool

func DeleteFeed

func DeleteFeed(id int64) bool

func Load

func Load(path string) (err error)

func PeersStorage

func PeersStorage() peers.Storage

func Save

func Save() (err error)

func UpdateChannelLastMessageID

func UpdateChannelLastMessageID(id int64, lastMessageID int) bool

Types

type Channel

type Channel struct {
	ID            int64  `json:"id"`
	ChannelID     int64  `json:"channel_id"`
	Name          string `json:"name"`
	FeedID        int64  `json:"feed_id"`
	LastMessageID int    `json:"last_message_id"`
}

func ChannelByChannelID

func ChannelByChannelID(channelID int64) *Channel

func ChannelByID

func ChannelByID(id int64) *Channel

func Channels

func Channels() []Channel

type Feed

type Feed struct {
	ID        int64  `json:"id"`
	ChannelID int64  `json:"channel_id"`
	Name      string `json:"name"`
}

func FeedByChannelID

func FeedByChannelID(channelID int64) *Feed

func FeedByID

func FeedByID(id int64) *Feed

func Feeds

func Feeds() []Feed

Jump to

Keyboard shortcuts

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