models

package
v0.0.0-...-175d474 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2017 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 Event

type Event struct {
	Id             int
	SiteId         int
	Resource       *string
	Referrer       *string
	Title          *string
	UserAgent      *string
	CreatedAt      time.Time
	BrowserName    *string
	BrowserVersion *string
}

func (Event) FromRow

func (e Event) 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 Site

type Site struct {
	Id        int
	UserId    int
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Site) CanCreate

func (s *Site) CanCreate(u *User) bool

func (*Site) CanDelete

func (s *Site) CanDelete(u *User) bool

func (*Site) CanUpdate

func (s *Site) CanUpdate(u *User) bool

func (*Site) CanView

func (s *Site) CanView(u *User) bool

func (*Site) FromRow

func (s *Site) 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