orm

package
v0.0.0-...-87de96b Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package orm provides `GORM` helpers for the creation, migration and access on the project's database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ORM

type ORM struct {
	DB *gorm.DB
}

ORM struct to holds the gorm pointer to db

func Factory

func Factory(config *context.MasterConfig) (*ORM, error)

Factory creates a db connection with the selected dialect and connection string

func (*ORM) FindUserByAPIKey

func (o *ORM) FindUserByAPIKey(apiKey string) (*model.User, error)

FindUserByAPIKey finds the user that is related to the API key

func (*ORM) FindUserByJWT

func (o *ORM) FindUserByJWT(email string, provider string, userID string) (*model.User, error)

FindUserByJWT finds the user that is related to the APIKey token

func (*ORM) UpsertUserProfile

func (o *ORM) UpsertUserProfile(input *goth.User) (*model.User, error)

UpsertUserProfile saves the user if doesn't exists and adds the OAuth profile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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