database

package
v0.0.0-...-12e9062 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DbName - database name
	DbName string = config.GetEnvVar("DATABASE_NAME")
	// ConnectionString - string for connecting to database
	ConnectionString string = config.GetEnvVar("DATABASE_CONNECTION_STRING")
)

Functions

func AddChannel

func AddChannel(channel models.Channel) error

AddChannel add new channel to database

func AddUser

func AddUser(user models.User) error

AddUser add a user to database

func Connect

func Connect(connString string) *mongo.Client

Connect to database

func GetChannels

func GetChannels() ([]models.Channel, error)

GetChannels ...

func GetUserByUsername

func GetUserByUsername(username string) (models.User, error)

GetUserByUsername ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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