models

package
v0.0.0-...-d3dc774 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2017 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission struct {
	ID          int    `goedb:"pk,autoincrement"`
	Name        string `goedb:"unique"`
	Description string
}

type PermissionsGroup

type PermissionsGroup struct {
	Role       Role       `goedb:"pk,fk=Role(ID)"`
	Permission Permission `goedb:"pk,fk=Permission(ID)"`
}

TODO: Check how goedb works with multiple PKs

type Role

type Role struct {
	ID          int    `goedb:"pk,autoincrement"`
	Name        string `goedb:"unique"`
	Description string
	Permissions []Permission `goedb:"ignore"`
}

type User

type User struct {
	ID       int    `goedb:"pk,autoincrement"`
	Email    string `goedb:"unique"`
	Password string
	Role     Role `goedb:"fk=Role(ID)"`
}

Jump to

Keyboard shortcuts

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