model

package
v0.0.0-...-e0f908e Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	ID     int    `json:"id"`
	Digits string `json:"digits"`
	Cvv    int    `json:"cvv"`
	Date   string `json:"date"`
	Owner  string `json:"owner"`
}

Card ...

func TestCard

func TestCard(t *testing.T) *Card

TestCard ...

func (*Card) Validate

func (c *Card) Validate() error

Validate ...

type User

type User struct {
	ID                int    `json:"id"`
	Email             string `json:"email"`
	Password          string `json:"password,omitempty"`
	EncryptedPassword string `json:"-"`
}

User ...

func TestUser

func TestUser(t *testing.T) *User

TestUser ...

func (*User) BeforeCreate

func (u *User) BeforeCreate() error

BeforeCreate ...

func (*User) ComparePassword

func (u *User) ComparePassword(password string) bool

ComparePassword ...

func (*User) Sanitize

func (u *User) Sanitize()

Sanitize ...

func (*User) Validate

func (u *User) Validate() error

Validate ...

Jump to

Keyboard shortcuts

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