feat: allow disable registration (#71)

This commit is contained in:
Hayden 2022-10-14 14:02:16 -08:00 committed by GitHub
parent ba8367f637
commit dea2dcfde8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 12 deletions

View file

@ -19,10 +19,17 @@ func WithDemoStatus(demoStatus bool) func(*V1Controller) {
}
}
func WithRegistration(allowRegistration bool) func(*V1Controller) {
return func(ctrl *V1Controller) {
ctrl.allowRegistration = allowRegistration
}
}
type V1Controller struct {
svc *services.AllServices
maxUploadSize int64
isDemo bool
svc *services.AllServices
maxUploadSize int64
isDemo bool
allowRegistration bool
}
type (
@ -53,7 +60,8 @@ func BaseUrlFunc(prefix string) func(s string) string {
func NewControllerV1(svc *services.AllServices, options ...func(*V1Controller)) *V1Controller {
ctrl := &V1Controller{
svc: svc,
svc: svc,
allowRegistration: true,
}
for _, opt := range options {