repo

package
v0.1.4-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgreDB

func NewPostgreDB(cfg Config) (*sql.DB, error)

Types

type Config

type Config struct {
	Host     string
	Port     string
	SSLMode  string
	DBName   string
	User     string
	Password string
}

type Repo

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

func NewAuthorizationRepo

func NewAuthorizationRepo(dbAuthMain, dbAuthRead, dbBlade *sql.DB) *Repo

func (*Repo) CreateAccount

func (r *Repo) CreateAccount(account *models.Account,
	remoteAddr, linkKey string, inviteCodeRequired bool) (int64, error)

Create a new account

----------------
Return:
	confirmationID int64
	error  - system or custom error (format FLNNN:[details]):
	         ------------------------------------------------
	         FL100 - Param account.Email is not valid
	         FL101 - Parap account.InviteCode is not valid
	         FL102 - Param account.Language is not valid
	         FL103 - An account with the specified email already exists
	         FL104 - The invite code does not exist or is expired
	         FL105 - The limit for issuing this invite code has been exhausted
	         FL106 - Param remoteAddr is not valid
	         FL107 - Param linkKey is not valid

Jump to

Keyboard shortcuts

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