mongodb

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

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

func (Accounts) AddClan

func (s Accounts) AddClan(serverKey string, clan types.Clan) error

func (Accounts) AddServer

func (s Accounts) AddServer(snowflake string, server types.Server) error

func (Accounts) All

func (s Accounts) All(accounts *[]types.Account) error

func (Accounts) GetByDiscordGuild

func (s Accounts) GetByDiscordGuild(key string, account *types.Account) error

func (Accounts) GetByServerKey

func (s Accounts) GetByServerKey(key string, account *types.Account) error

func (Accounts) Remove

func (s Accounts) Remove(key string) error

func (Accounts) RemoveClan

func (s Accounts) RemoveClan(serverKey, clanTag string) error

func (Accounts) RemoveServer

func (s Accounts) RemoveServer(snowflake, serverKey string) error

func (Accounts) SetClans

func (s Accounts) SetClans(key string, clans []types.Clan) error

func (Accounts) UpdateServer

func (s Accounts) UpdateServer(snowflake string, server types.Server) error

func (Accounts) UpsertBase

func (s Accounts) UpsertBase(account types.BaseAccount) error

type Chats

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

A Chats implements db.ChatsStore

func (Chats) GetNext

func (c Chats) GetNext(serverKey string, chatMessage *types.ChatMessage) error

func (Chats) Log

func (c Chats) Log(cm types.ChatMessage) error

Log implements db.ChatsStore.Log by inserting into the chats collection

type Config

type Config struct {
	DialAddress string // the mgo.Dial address
	Database    string // the database name
}

A Config is exactly what it sounds like.

type DiscordAuths

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

A DiscordAuths implements db.DiscordAuthsStore

func (DiscordAuths) Get

func (d DiscordAuths) Get(discordName string, da *types.DiscordAuth) error

func (DiscordAuths) GetSnowflake

func (d DiscordAuths) GetSnowflake(snowflake string, da *types.DiscordAuth) error

func (DiscordAuths) Remove

func (d DiscordAuths) Remove(si types.SteamInfo) error

Remove implements db.DiscordAuthsStore.Remove

func (DiscordAuths) Upsert

func (d DiscordAuths) Upsert(da types.DiscordAuth) error

Upsert implements db.DiscordAuthsStore.Upsert

type MongoDb

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

An MongoDb implements storage.Storage for MongoDB

func NewMongoDB

func NewMongoDB(mc Config) (*MongoDb, error)

NewMongoDB returns a connected Mgo

func (MongoDb) Accounts

func (m MongoDb) Accounts() storage.AccountsStore

ServerAccounts implements storage.Storage.ServerAccounts

func (MongoDb) Chats

func (m MongoDb) Chats() storage.ChatsStore

Chats implements storage.Storage.Chats

func (MongoDb) Close

func (m MongoDb) Close()

Close implements storage.Storage.Close

func (MongoDb) Copy

func (m MongoDb) Copy() storage.Storage

Copy implements storage.Storage.Copy

func (MongoDb) DiscordAuths

func (m MongoDb) DiscordAuths() storage.DiscordAuthsStore

DiscordAuths implements storage.Storage.DiscordAuths

func (MongoDb) Init

func (m MongoDb) Init()

Init implements storage.Storage.Init

func (MongoDb) RaidAlerts

func (m MongoDb) RaidAlerts() storage.RaidAlertsStore

RaidAlerts implements storage.Storage.RaidAlerts

func (MongoDb) Users

func (m MongoDb) Users() storage.UsersStore

Users implements storage.Storage.Users

type RaidAlerts

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

A RaidAlerts implements storage.RaidAlertsStore

func (RaidAlerts) AddInfo

func (r RaidAlerts) AddInfo(alertIn time.Duration, ed types.EntityDeath) error

AddInfo implements storage.RaidAlertsStore.AddInfo

func (RaidAlerts) GetReady

func (r RaidAlerts) GetReady(alerts *[]types.RaidAlert) error

GetReady implements storage.RaidAlertsStore.GetReady

func (RaidAlerts) Remove

func (r RaidAlerts) Remove(alert types.RaidAlert) error

Remove implements storage.RaidAlertsStore.Remove

type Users

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

A Users implements db.UsersStore

func (Users) Get

func (u Users) Get(steamID uint64, user *types.User) error

Get implements db.UsersStore.Get

func (Users) UpsertBase

func (u Users) UpsertBase(user types.BaseUser) error

UpsertBase implements db.UsersStore.UpsertBase

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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