team

package
v6.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 14 Imported by: 0 modules, 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 implements the `team` commands.

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadOnly       = []string{"version"}
	MemberReadOnly = []string{"name", "pictureUrl", "managedBy"}
	MemberKeys     = []string{"username", "email"}
)

The version is dropped as `service get` drops it. Members are sent back as the platform takes them, by username, email and role; the rest describes the user. Either the username or the email names the member.

View Source
var AlwaysAllowed = []string{"wait", "service-validation"}

AlwaysAllowed are the actions every team may use. The platform adds them to whatever list of allowed actions it is sent, so a team never has none.

Functions

func AddEnvironments

func AddEnvironments(ctx context.Context, c *platform.Client, o EnvironmentOptions) error

func AddMembers

func AddMembers(ctx context.Context, c *platform.Client, o MemberOptions) error

func Apply

func Apply(ctx context.Context, c *platform.Client, o ApplyOptions) error

Apply upserts teams by their key, which is what names a team; there is no id to write back. The id `get` writes is not sent: the platform goes by the key alone, and another platform's id in the file would only contradict it.

func Delete

func Delete(ctx context.Context, c *platform.Client, o DeleteOptions) error

func Get

func List

func ListEnvironments

func ListEnvironments(ctx context.Context, c *platform.Client, key, explicitType string) error

func ListMembers

func ListMembers(ctx context.Context, c *platform.Client, key, explicitType string) error

func NoteAlwaysAllowed added in v6.5.0

func NoteAlwaysAllowed(file string, doc *jsyaml.Map)

NoteAlwaysAllowed tells, on stderr, when a file's allowed actions leave out actions the platform allows every team anyway, so that `allowedActions: []` is not read as a team that may run nothing.

func RemoveEnvironments

func RemoveEnvironments(ctx context.Context, c *platform.Client, o EnvironmentOptions) error

func RemoveMembers

func RemoveMembers(ctx context.Context, c *platform.Client, o MemberOptions) error

func SetEnvironments

func SetEnvironments(ctx context.Context, c *platform.Client, o EnvironmentOptions) error

SetEnvironments replaces the environments a team may use.

func SetMembers

func SetMembers(ctx context.Context, c *platform.Client, o MemberOptions) error

SetMembers replaces the members: everyone not given is removed from the team.

func WarnSkippedMembers added in v6.5.0

func WarnSkippedMembers(file string, doc *jsyaml.Map, saved []byte)

WarnSkippedMembers tells, on stderr, about each member of a file the platform left out of the team it saved: by default it skips usernames and emails that are no user of the tenant. It goes by the username where the file gives one and by the email otherwise, as the platform does. Emails compare regardless of case: the platform stores them in lower case, and a capitalised email it failed to find is missing from the team anyway.

Types

type ApplyOptions

type ApplyOptions struct {
	Files     []string
	Recursive bool
	// ValidateMembers makes the platform refuse a team whose file names a member that is
	// no user of the tenant, instead of leaving the member out.
	ValidateMembers bool
}

type DeleteOptions

type DeleteOptions struct {
	Key         string
	Experiments bool
	Yes         bool
}

type EnvironmentOptions

type EnvironmentOptions struct {
	Key          string
	Environments []string
	Validate     bool
	Yes          bool
}

type GetOptions

type GetOptions struct {
	Key, File, Type string
}

type ListOptions

type ListOptions struct {
	Search string
	Type   string
}

type MemberOptions

type MemberOptions struct {
	Key       string
	Usernames []string
	Emails    []string
	Role      string
	Validate  bool
	Yes       bool
}

MemberOptions names users by username or email; the platform takes either.

Jump to

Keyboard shortcuts

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