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

Method GetDataClassificationSetting

backend/store/setting.go:184–198  ·  view source on GitHub ↗

GetDataClassificationSetting gets the data classification setting.

(ctx context.Context, workspaceID string)

Source from the content-addressed store, hash-verified

182
183// GetDataClassificationSetting gets the data classification setting.
184func (s *Store) GetDataClassificationSetting(ctx context.Context, workspaceID string) (*storepb.DataClassificationSetting, error) {
185 setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_DATA_CLASSIFICATION)
186 if err != nil {
187 return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_DATA_CLASSIFICATION)
188 }
189 if setting == nil {
190 return &storepb.DataClassificationSetting{}, nil
191 }
192
193 val, ok := setting.Value.(*storepb.DataClassificationSetting)
194 if !ok {
195 return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_DATA_CLASSIFICATION)
196 }
197 return val, nil
198}
199
200func (s *Store) GetAISetting(ctx context.Context, workspaceID string) (*storepb.AISetting, error) {
201 setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_AI)

Callers 5

CreateProjectMethod · 0.80
UpdateProjectMethod · 0.80
UpdateSettingMethod · 0.80
MaskResultsMethod · 0.80

Calls 2

GetSettingMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected