models

package
v0.0.0-...-752aab6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoOAuthRows = errors.New("no rows in oauth query")

Functions

func CreateUser

func CreateUser(dao *daos.Dao, email, username string) (*pbmodels.Record, error)

func DeleteOAuthByUserId

func DeleteOAuthByUserId(dao *daos.Dao, userId, provider string) error

func OAuthQuery

func OAuthQuery(dao *daos.Dao) *dbx.SelectQuery

Types

type OAuth

type OAuth struct {
	models.BaseModel

	// Fields
	Provider     string         `db:"provider"`
	AccessToken  string         `db:"access_token"`
	RefreshToken string         `db:"refresh_token"`
	TokenType    string         `db:"token_type"`
	Expiry       types.DateTime `db:"expiry"`

	// Relations
	UserId string `db:"user"`
}

func GetOAuthByUserId

func GetOAuthByUserId(dao *daos.Dao, userId, provider string) (*OAuth, error)

func (*OAuth) Save

func (o *OAuth) Save(dao *daos.Dao) error

func (*OAuth) TableName

func (*OAuth) TableName() string

func (*OAuth) UpdateOAuth

func (o *OAuth) UpdateOAuth(dao *daos.Dao, token *oauth2.Token) error

Jump to

Keyboard shortcuts

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