MCPcopy Index your code
hub / github.com/bytebase/bytebase / GetSystemSetting

Method GetSystemSetting

backend/store/setting.go:108–122  ·  view source on GitHub ↗
(ctx context.Context, workspaceID string)

Source from the content-addressed store, hash-verified

106}
107
108func (s *Store) GetSystemSetting(ctx context.Context, workspaceID string) (*storepb.SystemSetting, error) {
109 setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_SYSTEM)
110 if err != nil {
111 return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_SYSTEM)
112 }
113 if setting == nil {
114 return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_SYSTEM)
115 }
116
117 val, ok := setting.Value.(*storepb.SystemSetting)
118 if !ok {
119 return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_SYSTEM)
120 }
121 return val, nil
122}
123
124// UpdateLicense updates the license in SYSTEM setting.
125func (s *Store) UpdateLicense(ctx context.Context, workspaceID string, license string) error {

Callers 1

Calls 2

GetSettingMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected