models

package
v0.0.0-...-096236b Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	Id                 int
	UserId             int
	Uuid               string
	Name               string
	Description        *string
	CreatedAt          time.Time
	UpdatedAt          time.Time
	RecaptchaSecretKey *string
}

func (*Form) CanCreate

func (f *Form) CanCreate(u *User) bool

func (*Form) CanDelete

func (f *Form) CanDelete(u *User) bool

func (*Form) CanUpdate

func (f *Form) CanUpdate(u *User) bool

func (*Form) CanView

func (f *Form) CanView(u *User) bool

func (*Form) FromRow

func (f *Form) FromRow(row Scannable) error

type Permissible

type Permissible interface {
	CanCreate(*User) bool
	CanView(*User) bool
	CanUpdate(*User) bool
	CanDelete(*User) bool
}

type Scannable

type Scannable interface {
	Scan(...interface{}) error
}

type Submission

type Submission struct {
	Id        int
	FormId    int
	Body      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Submission) FromRow

func (s *Submission) FromRow(row Scannable) error

type User

type User struct {
	Id                     int
	Name                   string
	Email                  string
	PasswordDigest         string
	CreatedAt              time.Time
	UpdatedAt              time.Time
	EmailConfirmationToken *string
	IsEmailConfirmed       bool
}

func (*User) CanCreate

func (u *User) CanCreate(resource Permissible) bool

func (*User) CanDelete

func (u *User) CanDelete(resource Permissible) bool

func (*User) CanUpdate

func (u *User) CanUpdate(resource Permissible) bool

func (*User) CanView

func (u *User) CanView(resource Permissible) bool

func (*User) FromRow

func (u *User) FromRow(row Scannable) error

Jump to

Keyboard shortcuts

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