user

package module
v0.0.0-...-fda234a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyToken

func VerifyToken(ctx context.Context, userUUID string, publicKey string) error

Types

type Address

type Address struct {
	UUID        string     `json:"uuid" gorm:"primary_key"`
	UserUUID    string     `json:"user_uuid"`
	ZipCode     string     `json:"zipcode"`
	Country     string     `json:"country"`
	State       string     `json:"state"`
	City        string     `json:"city"`
	AddressLine string     `json:"address_line"`
	Disabled    bool       `json:"disabled"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	DeletedAt   *time.Time `json:"deleted_at" sql:"index"`
}

type User

type User struct {
	UUID                   string     `json:"uuid" gorm:"primary_key"`
	Username               string     `json:"username"`
	FirstName              string     `json:"first_name"`
	LastName               string     `json:"last_name"`
	Age                    int32      `json:"age"`
	Addresses              []Address  `json:"addresses" gorm:"foreignkey:UserUUID;association_foreignkey:UUID"`
	PasswordHash           string     `json:"password_hash"`
	DefaultPaymentInfoUUID string     `json:"default_paymentinfo_uuid"`
	CreatedAt              time.Time  `json:"created_at"`
	UpdatedAt              time.Time  `json:"updated_at"`
	DeletedAt              *time.Time `json:"deleted_at" sql:"index"`
}

type UserRepository

type UserRepository interface {
	FindByUUID(string) (*User, error, error)
	Store(*User) (string, error)
	Update(*User) error
	DeleteByUUID(string) error
	InitDB() error
}

type UserRepositoryMySQLConfig

type UserRepositoryMySQLConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	DBName   string
}

func (*UserRepositoryMySQLConfig) Connect

func (c *UserRepositoryMySQLConfig) Connect() (UserRepository, func() error, error)

Jump to

Keyboard shortcuts

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