storage

package
v1.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "storage"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Admins []string `mapstructure:"admins"`
}

type FeedItemStorage

type FeedItemStorage interface {
	Save(ctx context.Context, model *models.FeedItem) error
	Delete(ctx context.Context, id string) error
	Count(ctx context.Context, filter any) (int64, error)
	Find(ctx context.Context, criteria mongoext.Criteria) ([]models.FeedItem, error)
	FindById(ctx context.Context, id string) (models.FeedItem, error)
}

type FeedStorage

type FeedStorage interface {
	Save(ctx context.Context, model *models.Feed) error
	Delete(ctx context.Context, id string) error
	Count(ctx context.Context, filter any) (int64, error)
	Find(ctx context.Context, criteria mongoext.Criteria) ([]models.Feed, error)
	FindByLink(ctx context.Context, link string) (models.Feed, error)
	FindById(ctx context.Context, id string) (models.Feed, error)
}

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) FeedItemStorage

func (p *Plugin) FeedItemStorage() FeedItemStorage

func (*Plugin) FeedStorage

func (p *Plugin) FeedStorage() FeedStorage

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger, db *mongo.Database) error

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns user-friendly plugin name

func (*Plugin) Provides

func (p *Plugin) Provides() []any

Provides declares factory methods.

func (*Plugin) RoomStorage

func (p *Plugin) RoomStorage() RoomStorage

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

func (*Plugin) UserStorage

func (p *Plugin) UserStorage() UserStorage

type RoomStorage

type RoomStorage interface {
	Save(ctx context.Context, model *models.Room) error
	Count(ctx context.Context, filter any) (int64, error)
	Find(ctx context.Context, criteria mongoext.Criteria) ([]models.Room, error)
	FindById(ctx context.Context, id int64) (models.Room, error)
}

type UserStorage

type UserStorage interface {
	Find(ctx context.Context, criteria mongoext.Criteria) ([]models.User, error)
	FindById(ctx context.Context, id string) (models.User, error)
	FindByUsername(ctx context.Context, username string) (models.User, error)
	Count(ctx context.Context, filter any) (int64, error)
	Save(ctx context.Context, model *models.User) error
	Delete(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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