feat: add secret session workspace setting

This commit is contained in:
Steven
2023-06-27 22:15:26 +08:00
parent 106cdfa7da
commit 2fb0d145a2
9 changed files with 100 additions and 47 deletions

View File

@ -6,13 +6,33 @@ import (
"strings"
)
type WorkspaceSettingKey string
const (
// WorkspaceDisallowSignUp is the key type for disallow sign up in workspace level.
WorkspaceDisallowSignUp WorkspaceSettingKey = "disallow-signup"
// WorkspaceSecretSessionName is the key type for secret session name.
WorkspaceSecretSessionName WorkspaceSettingKey = "secret-session-name"
)
// String returns the string format of WorkspaceSettingKey type.
func (key WorkspaceSettingKey) String() string {
switch key {
case WorkspaceDisallowSignUp:
return "disallow-signup"
case WorkspaceSecretSessionName:
return "secret-session-name"
}
return ""
}
type WorkspaceSetting struct {
Key string
Key WorkspaceSettingKey
Value string
}
type FindWorkspaceSetting struct {
Key string
Key WorkspaceSettingKey
}
func (s *Store) UpsertWorkspaceSetting(ctx context.Context, upsert *WorkspaceSetting) (*WorkspaceSetting, error) {