Documentation ¶
Index ¶
- Variables
- type DatabaseOperations
- type FakeOperations
- type Operations
- type Service
- func (s *Service) AddUser(ctx context.Context, request *teampb.AddUserRequest) (*teampb.Empty, error)
- func (s *Service) Create(ctx context.Context, request *teampb.CreateRequest) (*teampb.Empty, error)
- func (s *Service) List(ctx context.Context, _ *teampb.Empty) (*teampb.ListResponse, error)
- func (s *Service) RegisterService(grpcServer *grpc.Server)
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") )
Functions ¶
This section is empty.
Types ¶
type DatabaseOperations ¶
type DatabaseOperations struct { DB *gorm.DB UserOps user.Operations }
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) ListByUser ¶
func (dbt *DatabaseOperations) ListByUser(userEmail string) ([]*database.Team, error)
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) ListByUser ¶
func (f *FakeOperations) ListByUser(userEmail string) ([]*database.Team, error)
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) }
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) RegisterService ¶
Click to show internal directories.
Click to hide internal directories.