badger

package
v0.0.0-...-4c137d3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package badger provides the BadgerDB backend for storing data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string) (csufbot.Store, error)

New creates a new Badger database and wraps it into a Store.

func Open

func Open(path string) (*badger.DB, error)

Open opens a new Badger database.

func Wrap

func Wrap(db *badger.DB) csufbot.Store

Wrap wraps an existing database.

Types

type CourseStore

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

func (CourseStore) Close

func (db CourseStore) Close() error

func (CourseStore) Course

func (store CourseStore) Course(id lms.CourseID) (*csufbot.Course, error)

func (CourseStore) Courses

func (store CourseStore) Courses(out map[lms.CourseID]csufbot.Course) error

func (CourseStore) UpsertCourses

func (store CourseStore) UpsertCourses(courses ...csufbot.Course) error

type GuildStore

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

func (GuildStore) Close

func (db GuildStore) Close() error

func (GuildStore) Guild

func (store GuildStore) Guild(id discord.GuildID) (*csufbot.Guild, error)

func (GuildStore) SetCourses

func (store GuildStore) SetCourses(g discord.GuildID, cs map[lms.CourseID]discord.RoleID) error

type UserStore

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

func (UserStore) Close

func (db UserStore) Close() error

func (UserStore) Sync

func (store UserStore) Sync(id discord.UserID, new csufbot.UserInService) error

func (UserStore) User

func (store UserStore) User(id discord.UserID) (*csufbot.User, error)

Jump to

Keyboard shortcuts

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