repository

package
v0.0.0-...-21f6f0f Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db

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

func New

func New() (*Db, error)

func (*Db) GetServerEmote

func (db *Db) GetServerEmote(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)

Takes in an emote and returns a leaderboard of the top users who have used that emote

func (*Db) GetUserEmotes

func (db *Db) GetUserEmotes(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)

func (*Db) IncrementEmote

func (db *Db) IncrementEmote(ctx context.Context, emote *emotes.Emote) error

func (*Db) NewIndex

func (a *Db) NewIndex(database string, collectionName string, field string, unique bool)

type Repository

type Repository interface {
	IncrementEmote(ctx context.Context, emote *emotes.Emote) error
	GetUserEmotes(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)
	GetServerEmote(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)
}

type Sql

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

func NewSql

func NewSql() (*Sql, error)

func (*Sql) GetServerEmote

func (db *Sql) GetServerEmote(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)

func (*Sql) GetUserEmotes

func (db *Sql) GetUserEmotes(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)

func (*Sql) IncrementEmote

func (db *Sql) IncrementEmote(ctx context.Context, emote *emotes.Emote) error

type Sqlrepository

type Sqlrepository interface {
	IncrementEmote(ctx context.Context, emote *emotes.Emote) error
	GetUserEmotes(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)
	GetServerEmote(ctx context.Context, emote *emotes.Emote) ([]emotes.Emote, error)
}

Jump to

Keyboard shortcuts

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