db

package
v0.0.0-...-f9d1dbd Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Hives []HiveConfiguration `json:"hives"`
}

type Database

type Database interface {
	ConfigForGuild(guildID string) (*Configuration, error)
}

func NewLocalDB

func NewLocalDB(path string) (Database, error)

func NewMongoDB

func NewMongoDB(url, db string) (Database, error)

type HiveConfiguration

type HiveConfiguration struct {
	RequestChannelIDs  []string `json:"requestChannelIDs"`
	JunkyardCategoryID string   `json:"junkyardCategoryID"`
	TextCategoryID     string   `json:"textCategoryID"`
	VoiceCategoryID    string   `json:"voiceCategoryID"`
	Prefix             string   `json:"prefix"`
	VoiceBitrate       int      `json:"voiceBitrate"`
}

type LocalDatabase

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

func (*LocalDatabase) ConfigForGuild

func (l *LocalDatabase) ConfigForGuild(guildID string) (*Configuration, error)

type MongoDatabase

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

func (*MongoDatabase) ConfigForGuild

func (m *MongoDatabase) ConfigForGuild(guildID string) (*Configuration, error)

TODO: Add cache!

Jump to

Keyboard shortcuts

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