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

Method GetAppIMSetting

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

Source from the content-addressed store, hash-verified

90}
91
92func (s *Store) GetAppIMSetting(ctx context.Context, workspaceID string) (*storepb.AppIMSetting, error) {
93 setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_APP_IM)
94 if err != nil {
95 return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_APP_IM)
96 }
97 if setting == nil {
98 return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_APP_IM)
99 }
100
101 val, ok := setting.Value.(*storepb.AppIMSetting)
102 if !ok {
103 return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_APP_IM)
104 }
105 return val, nil
106}
107
108func (s *Store) GetSystemSetting(ctx context.Context, workspaceID string) (*storepb.SystemSetting, error) {
109 setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_SYSTEM)

Callers 1

postWebhookListMethod · 0.80

Calls 2

GetSettingMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected