Documentation
¶
Index ¶
- Variables
- type CreateParams
- type Organization
- type OrganizationWithRole
- type Repository
- type RepositoryWithLogging
- func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (op1 *Organization, err error)
- func (_d RepositoryWithLogging) Delete(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (err error)
- func (_d RepositoryWithLogging) DeletionBlocked(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (b1 bool, err error)
- func (_d RepositoryWithLogging) FindBySlug(ctx context.Context, tx postgres.DBTX, s slug.Slug) (op1 *Organization, err error)
- func (_d RepositoryWithLogging) FindBySlugForUpdate(ctx context.Context, tx postgres.DBTX, s slug.Slug) (op1 *Organization, err error)
- func (_d RepositoryWithLogging) ListByUser(ctx context.Context, tx postgres.DBTX, userSlug slug.Slug, ...) (opa1 []*OrganizationWithRole, err error)
- func (_d RepositoryWithLogging) Update(ctx context.Context, tx postgres.DBTX, params *UpdateParams) (err error)
- func (_d RepositoryWithLogging) UpdateSettings(ctx context.Context, tx postgres.DBTX, params *UpdateSettingsParams) (err error)
- type UpdateParams
- type UpdateSettingsParams
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = xerror.NotFound(xerror.Organization) ErrSlugAlreadyExists = xerror.AlreadyExists(xerror.Organization) )
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type Organization ¶
type OrganizationWithRole ¶
type OrganizationWithRole struct {
Organization
MemberRole string
}
type Repository ¶
type Repository interface {
DeletionBlocked(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (bool, error)
Delete(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) error
Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (*Organization, error)
FindBySlug(ctx context.Context, tx postgres.DBTX, s slug.Slug) (*Organization, error)
FindBySlugForUpdate(ctx context.Context, tx postgres.DBTX, s slug.Slug) (*Organization, error)
Update(ctx context.Context, tx postgres.DBTX, params *UpdateParams) error
UpdateSettings(ctx context.Context, tx postgres.DBTX, params *UpdateSettingsParams) error
ListByUser(
ctx context.Context,
tx postgres.DBTX,
userSlug slug.Slug,
req model.ListRequest,
) ([]*OrganizationWithRole, 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) Create ¶
func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (op1 *Organization, err error)
Create implements Repository.
func (RepositoryWithLogging) Delete ¶
func (_d RepositoryWithLogging) Delete(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (err error)
Delete implements Repository.
func (RepositoryWithLogging) DeletionBlocked ¶
func (_d RepositoryWithLogging) DeletionBlocked(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug) (b1 bool, err error)
DeletionBlocked implements Repository.
func (RepositoryWithLogging) FindBySlug ¶
func (_d RepositoryWithLogging) FindBySlug(ctx context.Context, tx postgres.DBTX, s slug.Slug) (op1 *Organization, err error)
FindBySlug implements Repository.
func (RepositoryWithLogging) FindBySlugForUpdate ¶
func (_d RepositoryWithLogging) FindBySlugForUpdate(ctx context.Context, tx postgres.DBTX, s slug.Slug) (op1 *Organization, err error)
FindBySlugForUpdate implements Repository.
func (RepositoryWithLogging) ListByUser ¶
func (_d RepositoryWithLogging) ListByUser(ctx context.Context, tx postgres.DBTX, userSlug slug.Slug, req model.ListRequest) (opa1 []*OrganizationWithRole, err error)
ListByUser implements Repository.
func (RepositoryWithLogging) Update ¶
func (_d RepositoryWithLogging) Update(ctx context.Context, tx postgres.DBTX, params *UpdateParams) (err error)
Update implements Repository.
func (RepositoryWithLogging) UpdateSettings ¶
func (_d RepositoryWithLogging) UpdateSettings(ctx context.Context, tx postgres.DBTX, params *UpdateSettingsParams) (err error)
UpdateSettings implements Repository.
type UpdateParams ¶
type UpdateSettingsParams ¶
Click to show internal directories.
Click to hide internal directories.