GetSemanticTypesSetting gets the semantic types setting.
(ctx context.Context, workspaceID string)
| 165 | |
| 166 | // GetSemanticTypesSetting gets the semantic types setting. |
| 167 | func (s *Store) GetSemanticTypesSetting(ctx context.Context, workspaceID string) (*storepb.SemanticTypeSetting, error) { |
| 168 | setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_SEMANTIC_TYPES) |
| 169 | if err != nil { |
| 170 | return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_SEMANTIC_TYPES) |
| 171 | } |
| 172 | if setting == nil { |
| 173 | return &storepb.SemanticTypeSetting{}, nil |
| 174 | } |
| 175 | |
| 176 | val, ok := setting.Value.(*storepb.SemanticTypeSetting) |
| 177 | if !ok { |
| 178 | return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_SEMANTIC_TYPES) |
| 179 | } |
| 180 | return val, nil |
| 181 | } |
| 182 | |
| 183 | // GetDataClassificationSetting gets the data classification setting. |
| 184 | func (s *Store) GetDataClassificationSetting(ctx context.Context, workspaceID string) (*storepb.DataClassificationSetting, error) { |
no test coverage detected