Documentation
¶
Index ¶
- Variables
- type CreateParams
- type Member
- type Repository
- type RepositoryWithLogging
- func (_d RepositoryWithLogging) CountByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (i1 int64, err error)
- func (_d RepositoryWithLogging) CountByRole(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, roleSlug slug.Slug) (i1 int64, err error)
- func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (mp1 *Member, err error)
- func (_d RepositoryWithLogging) Find(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, userSlug slug.Slug) (mp1 *Member, err error)
- func (_d RepositoryWithLogging) FindByEmail(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, email string) (mp1 *Member, err error)
- func (_d RepositoryWithLogging) ListByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (mpa1 []*Member, err error)
- func (_d RepositoryWithLogging) Remove(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, userSlug slug.Slug) (err error)
- func (_d RepositoryWithLogging) Update(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, userSlug slug.Slug, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = xerror.NotFound(xerror.Member) ErrAlreadyMember = xerror.AlreadyExists(xerror.Member) )
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (*Member, error)
Find(ctx context.Context, tx postgres.DBTX, orgSlug, userSlug slug.Slug) (*Member, error)
FindByEmail(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, email string) (*Member, error)
CountByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (int64, error)
CountByRole(
ctx context.Context,
tx postgres.DBTX,
orgSlug slug.Slug,
roleSlug slug.Slug,
) (int64, error)
ListByOrganization(
ctx context.Context,
tx postgres.DBTX,
orgSlug slug.Slug,
req model.ListRequest,
) ([]*Member, error)
Update(ctx context.Context, tx postgres.DBTX, orgSlug, userSlug, roleSlug slug.Slug) error
Remove(ctx context.Context, tx postgres.DBTX, orgSlug, userSlug slug.Slug) error
}
func NewRepository ¶
func NewRepository() Repository
func NewRepositoryWithLogging ¶
func NewRepositoryWithLogging(base Repository, logger *slog.Logger) Repository
NewRepositoryWithLogging wraps base with method completion logging.
type RepositoryWithLogging ¶
type RepositoryWithLogging struct {
// contains filtered or unexported fields
}
RepositoryWithLogging implements Repository with method completion logging.
func (RepositoryWithLogging) CountByOrganization ¶
func (_d RepositoryWithLogging) CountByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (i1 int64, err error)
CountByOrganization implements Repository.
func (RepositoryWithLogging) CountByRole ¶
func (_d RepositoryWithLogging) CountByRole(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, roleSlug slug.Slug) (i1 int64, err error)
CountByRole implements Repository.
func (RepositoryWithLogging) Create ¶
func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (mp1 *Member, err error)
Create implements Repository.
func (RepositoryWithLogging) Find ¶
func (_d RepositoryWithLogging) Find(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, userSlug slug.Slug) (mp1 *Member, err error)
Find implements Repository.
func (RepositoryWithLogging) FindByEmail ¶
func (_d RepositoryWithLogging) FindByEmail(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, email string) (mp1 *Member, err error)
FindByEmail implements Repository.
func (RepositoryWithLogging) ListByOrganization ¶
func (_d RepositoryWithLogging) ListByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, req model.ListRequest) (mpa1 []*Member, err error)
ListByOrganization implements Repository.
Click to show internal directories.
Click to hide internal directories.