user

package module
v0.0.0-...-25d5232 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateEmail = errors.New("email has been picked by another account")
View Source
var ErrDuplicateGoogleId = errors.New("google account has been registered by another account")
View Source
var ErrDuplicateUsername = errors.New("username has been picked by another account")

Functions

This section is empty.

Types

type User

type User struct {
	Id        *datastore.Key `datastore:"__key__" json:"id"`
	Name      string         `json:"name"`
	Username  string         `json:"username"`
	Email     string         `json:"email"`
	GoogleId  string         `json:"-"`
	Picture   string         `json:"picture"`
	Blocked   bool           `json:"-" default:"false"`
	CreatedAt *time.Time     `json:"created_at"`
	UpdatedAt *time.Time     `json:"updated_at"`
	DeletedAt *time.Time     `json:"-"`
}

func (*User) Create

func (u *User) Create(ctx *context.Context, client *datastore.Client) error

func (*User) CreateFromGoogleClaims

func (u *User) CreateFromGoogleClaims(ctx *context.Context, client *datastore.Client, claims map[string]interface{}) error

func (*User) Delete

func (u *User) Delete(ctx *context.Context, client *datastore.Client) error

func (*User) Dto

func (u *User) Dto() *UserDto

func (*User) GetByGID

func (u *User) GetByGID(ctx *context.Context, gid string, client *datastore.Client) error

func (*User) GetById

func (u *User) GetById(ctx *context.Context, client *datastore.Client, id int64) error

func (*User) GetByIdWithTrash

func (u *User) GetByIdWithTrash(ctx *context.Context, client *datastore.Client, id int64) error

func (*User) SoftDelete

func (u *User) SoftDelete(ctx *context.Context, client *datastore.Client) error

func (*User) Update

func (u *User) Update(ctx *context.Context, client *datastore.Client) error

type UserDto

type UserDto struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	Picture  string `json:"picture"`
}

Jump to

Keyboard shortcuts

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