23 lines
575 B
Go
23 lines
575 B
Go
|
package datastore
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
type TenantRepository interface {
|
||
|
Create(ctx context.Context, label string) (*Tenant, error)
|
||
|
Get(ctx context.Context, id TenantID) (*Tenant, error)
|
||
|
Update(ctx context.Context, id TenantID, updates ...TenantUpdateOptionFunc) (*Tenant, error)
|
||
|
Delete(ctx context.Context, id TenantID) error
|
||
|
}
|
||
|
|
||
|
type TenantUpdateOptionFunc func(*TenantUpdateOptions)
|
||
|
|
||
|
type TenantUpdateOptions struct {
|
||
|
Label *string
|
||
|
}
|
||
|
|
||
|
func WithTenantUpdateLabel(label string) TenantUpdateOptionFunc {
|
||
|
return func(opts *TenantUpdateOptions) {
|
||
|
opts.Label = &label
|
||
|
}
|
||
|
}
|