teams

package
v0.0.0-...-e71a76f Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// V2 is a reference to the parent client.
	V2 clients.V2

	// Cache is used to cache the resources fetched inside the service.
	Cache *core.Cache
}

Client is the client for the User service.

func New

func New(v2 clients.V2, cache ...*core.Cache) *Client

New creates a new User service client.

func (*Client) CheckResourceAccess

func (c *Client) CheckResourceAccess(userID, resourceID string) (bool, error)

func (*Client) CleanResource

func (c *Client) CleanResource(resourceID string) error

CleanResource cleans a resource from all teams

func (*Client) Create

func (c *Client) Create(id, ownerID string, dtoCreateTeam *body.TeamCreate) (*model.Team, error)

Create creates a new team

Notifications are sent out if the owner of the team is not admin

func (*Client) Delete

func (c *Client) Delete(id string) error

Delete deletes a team

func (*Client) Get

func (c *Client) Get(id string, opts ...opts.GetOpts) (*model.Team, error)

Get gets a team by ID

func (*Client) Join

func (c *Client) Join(id string, dtoTeamJoin *body.TeamJoin) (*model.Team, error)

Join joins a team

It uses service.AuthInfo to get the user ID

func (*Client) List

func (c *Client) List(opts ...opts.ListOpts) ([]model.Team, error)

List lists teams

func (*Client) ListIDs

func (c *Client) ListIDs(opts ...opts.ListOpts) ([]string, error)

ListIDs lists team IDs

This is a more lightweight version of List when only the IDs are needed TODO: Fetch only IDs, right now ListIDs == List

func (*Client) RefreshTeam

func (c *Client) RefreshTeam(id string, tmc *team_repo.Client) (*model.Team, error)

RefreshTeam refreshes the Team with the given ID. After a successful fetch, the Team will be cached.

func (*Client) RefreshUser

func (c *Client) RefreshUser(id string, umc *user_repo.Client) (*model.User, error)

RefreshUser refreshes the User with the given ID. After a successful fetch, the User will be cached.

func (*Client) Team

func (c *Client) Team(id string, tmc *team_repo.Client) (*model.Team, error)

Team returns the Team with the given ID. After a successful fetch, the Team will be cached.

func (*Client) Teams

func (c *Client) Teams(tmc *team_repo.Client) ([]model.Team, error)

Teams returns a list of Teams. After a successful fetch, the Teams will be cached.

func (*Client) Update

func (c *Client) Update(id string, dtoUpdateTeam *body.TeamUpdate) (*model.Team, error)

Update updates a team

func (*Client) User

func (c *Client) User(id string, umc *user_repo.Client) (*model.User, error)

User returns the User with the given ID. After a successful fetch, the User will be cached.

func (*Client) Users

func (c *Client) Users(umc *user_repo.Client) ([]model.User, error)

Users returns a list of Users. After a successful fetch, the Users will be cached.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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