Documentation
¶
Index ¶
- func ConnectToDB(config configStruct.Configuration) (*sql.DB, error)
- func CreateJWT(userID string) (string, error)
- func DecodeJWT(JWT string) (string, error)
- func GetConfig(prefix string) config.Configuration
- func GetUser(dialect goqu.DialectWrapper, db *sql.DB, userID string, userEmail string) (models.User, error)
- func GetUserFromToken(currentContext context.Context, dialect goqu.DialectWrapper, db *sql.DB) (models.User, error)
- func Hash(text string) (string, error)
- func InitTables(dialect goqu.DialectWrapper, db *sql.DB) error
- func ValidHash(text string, hashedText string) (bool, error)
- type Claims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectToDB ¶
func ConnectToDB(config configStruct.Configuration) (*sql.DB, error)
ConnectToDB attempts to connect to the database and returns a pointer to the database along with an error if applicable
func GetConfig ¶
func GetConfig(prefix string) config.Configuration
GetConfig builds and returns a Configuration struct Loads from a .yml file
func GetUser ¶
func GetUser(dialect goqu.DialectWrapper, db *sql.DB, userID string, userEmail string) (models.User, error)
GetUser - Lookup the user based on ID, returns the model or alternatively an empty user along with an error
func GetUserFromToken ¶
func GetUserFromToken(currentContext context.Context, dialect goqu.DialectWrapper, db *sql.DB) (models.User, error)
GetUserFromToken - Lookup the user based on context (Authorization token) returns the user model or alternatively an error
func InitTables ¶
InitTables - Create and load DB tables with data returns an error or nil if no error ocurred
Types ¶
Click to show internal directories.
Click to hide internal directories.