db

package
v0.0.0-...-75c7a90 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2015 License: MIT Imports: 5 Imported by: 1

README

db

This package is used internally to make working with the database feel less painful.

Documentation

Overview

db sets up our database connection and exposes functions and methods to make working with data easier

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func LoadSQLite

func LoadSQLite(filename string) error

LoadSQLite loads the database as SQLite this should be used for local testing

func NewOutfit

func NewOutfit(Name, CID, LeaderSlack string, c *census.Census)

func NewReport

func NewReport(reporter, player, PSN, info string, c *census.Census) error

NewReport creates a new report with the provided information

Additionally, it creates an outfit instance if possible to reference if we need to.

Types

type Outfit

type Outfit struct {
	gorm.Model
	Name        string
	CID         string // CID is the ID given to it by census.
	LeaderSlack string // This is the username of the user in Slack

}

Outfit...

func GetOutfit

func GetOutfit(CID string) *Outfit

type Report

type Report struct {
	gorm.Model
	Reporter       string
	Name           string
	PSNName        string `gorm:"column:psn_name"`
	AdditionalInfo string
	OutfitCID      string `gorm:"column:outfit_cid"` // The outfit the user was in at the time of the report
	Cleared        bool
}

Report ...

func GetReport

func GetReport(ID int) *Report

GetReport gets a report by the ID

func (*Report) ToggleClear

func (r *Report) ToggleClear()

ToggleClear toggles the Cleared value in the database.

Jump to

Keyboard shortcuts

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