Documentation
¶
Overview ¶
Package team is the domain layer for the Team entity — the outer tenancy scope that owns Projects. A Team has no member list: membership is expressed as a role binding at team scope, so there is exactly one place that grants access.
Authorization is app/authz's concern; this package validates shape only.
Index ¶
Constants ¶
const DefaultPeriod = "month"
DefaultPeriod is the calendar period a Budget that names none is measured over.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Budget ¶
type Budget struct {
Amount string `json:"amount" yaml:"amount" validate:"required,budgetamount"`
Period string `json:"period,omitempty" yaml:"period,omitempty" validate:"omitempty,oneof=month week day"`
OnExceed string `json:"onExceed,omitempty" yaml:"onExceed,omitempty" validate:"omitempty,oneof=block warn"`
}
Budget is a recurring spend cap in USD. Amount is a decimal string so money never round-trips through a float.
type Spec ¶
type Spec struct {
// Enabled defaults to true when nil.
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
// Budget caps spend across every Project in the team.
Budget *Budget `json:"budget,omitempty" yaml:"budget,omitempty" validate:"omitempty"`
}
Spec carries the enabled flag and the team-wide spend cap.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
type Team ¶
type Team struct {
Meta meta.Metadata `json:"metadata" yaml:"metadata"`
Spec Spec `json:"spec" yaml:"spec"`
}
Team is the outer tenancy scope. Owner is the user who created it (user kind) or system for seeded rows.