db

package
v0.0.0-...-f46f3e0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

Interface between the server and its primary data store.

func New

func New(config *config.Config) (*DB, error)

Creates and initializes a new DB.

func (*DB) DoesUserExist

func (db *DB) DoesUserExist(userID uint) (bool, error)

Returns true if a user associated with the specified userID exists.

func (*DB) GoogleUser

func (db *DB) GoogleUser(googleUserID string) (*model.User, error)

Returns the user identified by the specified googleUserID, or nil if no such user exists.

func (*DB) RegisterGoogleUser

func (db *DB) RegisterGoogleUser(googleUser goth.User) (uint, error)

Creates an entry in the database for the specified googleUser.

func (*DB) User

func (db *DB) User(userID uint) (*model.User, error)

Returns the user identified by the specified userID, or nil if no such user exists.

func (*DB) UserIDOfGoogleUser

func (db *DB) UserIDOfGoogleUser(googleUserID string) (*uint, error)

Returns the ID of the user identified by the specified googleUserID, or nil if no such user exists.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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