team

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTeamAlreadyExists = status.Errorf(codes.AlreadyExists, "Team already exists")
	ErrUserAlreadyInTeam = status.Errorf(codes.AlreadyExists, "User already in Team")
	ErrNotFound          = status.Errorf(codes.NotFound, "Team Not Found")
	ErrUserNotInTeam     = status.Errorf(codes.NotFound, "User not in team")
)

Functions

This section is empty.

Types

type DatabaseOperations

type DatabaseOperations struct {
	DB      *gorm.DB
	UserOps user.Operations
	Ext     teamext.TeamExt
}

func (*DatabaseOperations) AddUser

func (dbt *DatabaseOperations) AddUser(name, userEmail string) error

func (*DatabaseOperations) Create

func (dbt *DatabaseOperations) Create(name, email, url string) error

func (*DatabaseOperations) HasUser added in v0.16.0

func (dbt *DatabaseOperations) HasUser(name, userEmail string) (bool, error)

func (*DatabaseOperations) List

func (dbt *DatabaseOperations) List() ([]*database.Team, error)

func (*DatabaseOperations) ListByUser

func (dbt *DatabaseOperations) ListByUser(userEmail string) ([]*database.Team, error)

func (*DatabaseOperations) RemoveUser added in v0.8.0

func (dbt *DatabaseOperations) RemoveUser(name, userEmail string) error

func (*DatabaseOperations) Rename added in v0.10.0

func (dbt *DatabaseOperations) Rename(oldName, newName string) error

func (*DatabaseOperations) SetTeamExt added in v0.10.0

func (dbt *DatabaseOperations) SetTeamExt(ext teamext.TeamExt)

type FakeOperations

type FakeOperations struct {
	Storage map[string]*database.Team

	UserOps user.Operations
	// contains filtered or unexported fields
}

func (*FakeOperations) AddUser

func (f *FakeOperations) AddUser(name, userEmail string) error

func (*FakeOperations) Create

func (f *FakeOperations) Create(name, email, url string) error

func (*FakeOperations) HasUser added in v0.16.0

func (f *FakeOperations) HasUser(name, userEmail string) (bool, error)

func (*FakeOperations) List

func (f *FakeOperations) List() ([]*database.Team, error)

func (*FakeOperations) ListByUser

func (f *FakeOperations) ListByUser(userEmail string) ([]*database.Team, error)

func (*FakeOperations) RemoveUser added in v0.8.0

func (f *FakeOperations) RemoveUser(name, userEmail string) error

func (*FakeOperations) Rename added in v0.10.0

func (f *FakeOperations) Rename(oldName, newName string) error

func (*FakeOperations) SetTeamExt added in v0.10.0

func (f *FakeOperations) SetTeamExt(ext teamext.TeamExt)

type Operations

type Operations interface {
	Create(name, email, url string) error
	AddUser(name, userEmail string) error
	List() ([]*database.Team, error)
	ListByUser(userEmail string) ([]*database.Team, error)
	RemoveUser(name, userEmail string) error
	Rename(oldName, newName string) error
	HasUser(name, userEmail string) (bool, error)
	SetTeamExt(ext teamext.TeamExt)
}

func NewDatabaseOperations

func NewDatabaseOperations(db *gorm.DB, uOps user.Operations) Operations

func NewFakeOperations

func NewFakeOperations() Operations

type Service

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

func NewService

func NewService(ops Operations) *Service

func (*Service) AddUser

func (s *Service) AddUser(ctx context.Context, request *teampb.AddUserRequest) (*teampb.Empty, error)

func (*Service) Create

func (s *Service) Create(ctx context.Context, request *teampb.CreateRequest) (*teampb.Empty, error)

func (*Service) List

func (s *Service) List(ctx context.Context, _ *teampb.Empty) (*teampb.ListResponse, error)

func (*Service) RegisterService

func (s *Service) RegisterService(grpcServer *grpc.Server)

func (*Service) RemoveUser added in v0.8.0

func (s *Service) RemoveUser(ctx context.Context, request *teampb.RemoveUserRequest) (*teampb.Empty, error)

func (*Service) Rename added in v0.10.0

func (s *Service) Rename(ctx context.Context, request *teampb.RenameRequest) (*teampb.Empty, error)

Jump to

Keyboard shortcuts

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