teams

package
v0.0.0-...-907143c Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Collection = "teams"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessGroups

type AccessGroups struct {
	Admin  []string `json:"admin"`
	Member []string `json:"member"`
	Viewer []string `json:"viewer"`
}

type ByAccess

type ByAccess struct {
	Admin  []Team
	Member []Team
	Viewer []Team
}

type Service

type Service interface {
	EnsureIndices() error

	ListTeamsPaginated(perPage int, page int) (TeamPage, error)
	GetTeam(id string) (Team, error)
	DeleteTeam(id string) error
	CreateTeam(id string, data TeamSettings) error
	UpdateTeam(id string, data TeamSettings) error
	TeamsForGroups(groups []string) (ByAccess, error)
}

func NewService

func NewService(db database.Database) Service

type Team

type Team struct {
	Id           string `json:"id" bson:"id"`
	TeamSettings `bson:",inline"`
}

type TeamPage

type TeamPage struct {
	sdk.Pagination
	Teams []Team `json:"teams"`
}

type TeamSettings

type TeamSettings struct {
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Access      AccessGroups `json:"access"`
}

Jump to

Keyboard shortcuts

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