models

package
v0.0.0-...-6a42fc5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *pop.Connection

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

Functions

This section is empty.

Types

type Post

type Post 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"`
	Title     string    `json:"title" db:"title"`
	Content   string    `json:"content" db:"content"`
	UserID    uuid.UUID `json:"user_id" db:"user_id" form:"-"`
}

Post struct for user posts

func (Post) String

func (p Post) String() string

String is not required by pop and may be deleted

func (*Post) Validate

func (p *Post) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run everytime you call a "pop.Validate" method. This method is not required and may be deleted.

func (*Post) ValidateSave

func (p *Post) ValidateSave(tx *pop.Connection) (*validate.Errors, error)

ValidateSave gets run everytime you call "pop.ValidateSave" method. This method is not required and may be deleted.

func (*Post) ValidateUpdate

func (p *Post) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

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

type Posts

type Posts []Post

Posts is not required by pop and may be deleted

func (Posts) String

func (p Posts) 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"`
	ProviderUserid string       `json:"provider_userid" db:"provider_userid"`
	GravatarID     nulls.String `json:"gravatar_id" db:"gravatar_id"`
	Provider       string       `json:"provider" db:"provider"`
	Nickname       nulls.String `json:"nickname" db:"nickname"`
}

User struct

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 everytime you call a "pop.Validate" method. This method is not required and may be deleted.

func (*User) ValidateSave

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

ValidateSave gets run everytime you call "pop.ValidateSave" 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 everytime you call "pop.ValidateUpdate" method. This method is not required 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

Jump to

Keyboard shortcuts

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