models

package
v0.0.0-...-1cfbb54 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DB is a connection to your database to be used throughout your application.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	ID          uuid.UUID `json:"id" db:"id"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	Name        string    `json:"name" db:"name"`
	Email       string    `json:"email" db:"email"`
	Description string    `json:"description" db:"description"`
}

Contact is orm for database contacts

func (Contact) String

func (c Contact) String() string

String is not required by pop and may be deleted

func (*Contact) Validate

func (c *Contact) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Contact) ValidateCreate

func (c *Contact) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Contact) ValidateUpdate

func (c *Contact) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Contacts

type Contacts []Contact

Contacts is not required by pop and may be deleted

func (Contacts) String

func (c Contacts) String() string

String is not required by pop and may be deleted

type User

type User struct {
	ID         uuid.UUID    `json:"id" db:"id"`
	CreatedAt  time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time    `json:"updated_at" db:"updated_at"`
	Name       string       `json:"name" db:"name"`
	Email      nulls.String `json:"email" db:"email"`
	Gender     nulls.String `json:"gender" db:"gender"` //TODO: string vs nulls.String
	Location   nulls.String `json:"location" db:"location"`
	Website    nulls.String `json:"website" db:"website"`
	Gravatar   nulls.String `json:"gravatar" db:"gravatar"`
	Provider   string       `json:"provider" db:"provider"`
	ProviderID string       `json:"provider_id" db:"provider_id"`
}

User is orm model for databse user

func (User) String

func (u User) String() string

String is not required by pop and may be deleted

func (*User) Validate

func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*User) ValidateCreate

func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*User) ValidateUpdate

func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type UserProfile

type UserProfile struct {
	ID         uuid.UUID    `json:"id" db:"id"`
	Name       string       `json:"name" db:"name"`
	CreatedAt  time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time    `json:"updated_at" db:"updated_at"`
	Provider   string       `json:"provider" db:"provider"`
	ProviderID string       `json:"provider_id" db:"provider_id"`
	Email      nulls.String `json:"email" db:"email"`
	Data       string       `json:"data" db:"data"`
	UserID     uuid.UUID    `json:"user_id" db:"user_id"`
}

UserProfile is orm for database user profile saves profile per login provider like facebook, github etc

func (UserProfile) String

func (u UserProfile) String() string

String is not required by pop and may be deleted

func (*UserProfile) Validate

func (u *UserProfile) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*UserProfile) ValidateCreate

func (u *UserProfile) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*UserProfile) ValidateUpdate

func (u *UserProfile) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type UserProfiles

type UserProfiles []UserProfile

UserProfiles is not required by pop and may be deleted

func (UserProfiles) String

func (u UserProfiles) String() string

String is not required by pop and may be deleted

type Users

type Users []User

Users is not required by pop and may be deleted

func (Users) String

func (u Users) String() string

String is not required by pop and may be deleted

type Widget

type Widget struct {
	ID         uuid.UUID    `json:"id" db:"id"`
	CreatedAt  time.Time    `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time    `json:"updated_at" db:"updated_at"`
	Name       string       `json:"name" db:"name"`
	Uploadfile binding.File `db:"-" form:"someFile"`
}

Widget is orm for widgets

func (*Widget) AfterCreate

func (w *Widget) AfterCreate(tx *pop.Connection) error

AfterCreate gets run every time after you save widget to database

func (Widget) String

func (w Widget) String() string

String is not required by pop and may be deleted

func (*Widget) Validate

func (w *Widget) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Widget) ValidateCreate

func (w *Widget) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Widget) ValidateUpdate

func (w *Widget) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Widgets

type Widgets []Widget

Widgets is not required by pop and may be deleted

func (Widgets) String

func (w Widgets) String() string

String is not required by pop and may be deleted

Jump to

Keyboard shortcuts

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