Documentation ¶
Index ¶
- Variables
- type ShortenedLink
- func (s *ShortenedLink) BeforeValidate(tx *pop.Connection) error
- func (s ShortenedLink) String() string
- func (s *ShortenedLink) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (s *ShortenedLink) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (s *ShortenedLink) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type ShortenedLinks
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
var DB *pop.Connection
DB is a connection to your database to be used throughout your application.
Functions ¶
This section is empty.
Types ¶
type ShortenedLink ¶
type ShortenedLink 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"` URL string `json:"url" db:"url"` ShortCode string `json:"short_code" db:"short_code"` Hits int `json:"hits" db:"hits"` }
ShortenedLink is used by pop to map your shortened_links database table to your go code.
func (*ShortenedLink) BeforeValidate ¶
func (s *ShortenedLink) BeforeValidate(tx *pop.Connection) error
func (ShortenedLink) String ¶
func (s ShortenedLink) String() string
String is not required by pop and may be deleted
func (*ShortenedLink) Validate ¶
func (s *ShortenedLink) 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 (*ShortenedLink) ValidateCreate ¶
func (s *ShortenedLink) 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 (*ShortenedLink) ValidateUpdate ¶
func (s *ShortenedLink) 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 ShortenedLinks ¶
type ShortenedLinks []ShortenedLink
ShortenedLinks is not required by pop and may be deleted
func (ShortenedLinks) String ¶
func (s ShortenedLinks) String() string
String is not required by pop and may be deleted
type User ¶
type User struct { ID uuid.UUID `json:"id" db:"id"` Name string `json:"name" db:"name"` Email string `json:"email" db:"email"` Provider string `json:"provider" db:"provider"` ProviderID string `json:"provider_id" db:"provider_id"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` }
User is used by pop to map your users database table to your go code.
func (*User) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*User) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.