organizations

package
v0.0.0-...-5106b98 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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 CreateParams struct {
	Name string
	Slug slug.Slug
}

type Organization

type Organization struct {
	Name      string
	Slug      slug.Slug
	Settings  []byte
	CreatedAt time.Time
	UpdatedAt time.Time
}

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 UpdateParams struct {
	Slug slug.Slug
	Name string
}

type UpdateSettingsParams

type UpdateSettingsParams struct {
	Slug     slug.Slug
	Settings []byte
}

Jump to

Keyboard shortcuts

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