statping: github.com/statping/statping/types/groups Index | Files

package groups

import "github.com/statping/statping/types/groups"

Index

Package Files

database.go samples.go struct.go

func Samples Uses

func Samples() error

func SetDB Uses

func SetDB(database database.Database)

type Group Uses

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 Uses

func All() []*Group

func Find Uses

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

func SelectGroups Uses

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

SelectGroups returns all groups

func (*Group) Create Uses

func (g *Group) Create() error

func (*Group) Delete Uses

func (g *Group) Delete() error

func (*Group) Update Uses

func (g *Group) Update() error

type GroupOrder Uses

type GroupOrder []*Group

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

func (GroupOrder) Len Uses

func (c GroupOrder) Len() int

Sort interface for resorting the Groups in order

func (GroupOrder) Less Uses

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

func (GroupOrder) Swap Uses

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

Package groups imports 6 packages (graph) and is imported by 9 packages. Updated 2020-06-01. Refresh now. Tools for package owners.