team

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	// Enabled defaults to true when nil.
	Enabled *bool `` /* 147-byte string literal not displayed */
}

Spec carries the enabled flag. A team's spend cap is a Budget its bound policy links.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(db storage.DB) *Store

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string) error

Delete relies on the FK to cascade the team's projects.

func (*Store) Directory added in v0.10.8

func (s *Store) Directory() directory.Store[directory.Team]

Directory is the auth module's store under this one, for writes that run through the directory.

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (*Team, error)

Get returns (nil, nil) when no row has id.

func (*Store) List

func (s *Store) List(ctx context.Context) ([]*Team, error)

func (*Store) Upsert

func (s *Store) Upsert(ctx context.Context, t *Team) error

Upsert expects Meta.ID set by the caller.

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.

func FromDirectory added in v0.10.8

func FromDirectory(r *directory.Team) (*Team, error)

FromDirectory is a directory row as a Team. A team written as system-owned reads as the organization's.

func (*Team) IsEnabled

func (t *Team) IsEnabled() bool

IsEnabled returns true when Enabled is unset or explicitly true.

func (*Team) ToDirectory added in v0.10.8

func (t *Team) ToDirectory() (*directory.Team, error)

ToDirectory is t as the directory stores it.

func (*Team) Validate

func (t *Team) Validate() error

Validate runs intra-row rules via the shared meta.Validator and enforces:

  • Owner.Kind is user or organization (system, its earlier name, is read as it).

Jump to

Keyboard shortcuts

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