groups

package
v0.90.49 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Samples

func Samples() error

func SetDB

func SetDB(database database.Database)

Types

type Group

type Group struct {
	Id        int64         `gorm:"primary_key;column:id" json:"id"`
	Name      string        `gorm:"column:name" json:"name"`
	Public    null.NullBool `gorm:"default:true;column:public" json:"public"`
	Order     int           `gorm:"default:0;column:order_id" json:"order_id"`
	CreatedAt time.Time     `gorm:"column:created_at" json:"created_at"`
	UpdatedAt time.Time     `gorm:"column:updated_at" json:"updated_at"`
}

Group is the main struct for Groups

func All

func All() []*Group

func Find

func Find(id int64) (*Group, error)

func SelectGroups

func SelectGroups(includeAll bool, auth bool) []*Group

SelectGroups returns all groups

func (*Group) Create

func (g *Group) Create() error

func (*Group) Delete

func (g *Group) Delete() error

func (*Group) Update

func (g *Group) Update() error

type GroupOrder

type GroupOrder []*Group

GroupOrder will reorder the groups based on 'order_id' (Order)

func (GroupOrder) Len

func (c GroupOrder) Len() int

Sort interface for resorting the Groups in order

func (GroupOrder) Less

func (c GroupOrder) Less(i, j int) bool

func (GroupOrder) Swap

func (c GroupOrder) Swap(i, j int)

Jump to

Keyboard shortcuts

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