team

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNameIsRequired = errors.New("field Name is required")

Functions

This section is empty.

Types

type Team

type Team struct {
	// this id refers to ID of a team in web.
	ID uuid.UUID `json:"id,omitempty" gorm:"type:uuid;primary_key;"`
	// Name is team name
	Name string `json:"name" gorm:"unique;not null"`
	// Pause is responsible for pausing the scoring
	Pause *bool `json:"pause,omitempty" gorm:"not null;default:false"`
	// Hide is responsible for hiding the Team on scoring table
	Hide *bool `json:"hide,omitempty" gorm:"not null;default:false"`
	// Index is team's index, which is a unique value used for templating (10.X.1.1, where X is an index) and sorting
	Index *uint64 `json:"index" gorm:"unique;"`
	// Users array stores all of the users that are part of a given Team
	Users []*user.User `gorm:"foreignkey:TeamID;association_foreignkey:ID;constraint:OnUpdate:RESTRICT,OnDelete:CASCADE" json:"-"`
	// Hosts array stores all Hosts that are part of a given Team
	Hosts []*host.Host `gorm:"foreignkey:TeamID;association_foreignkey:ID; constraint:OnUpdate:RESTRICT,OnDelete:RESTRICT" json:"hosts,omitempty"`
}

Team model represents internal team model of the scoring engine.

func (*Team) BeforeCreate

func (t *Team) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate ensures UUID is set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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