Document every exported symbol and how callers use the library.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -38,6 +38,8 @@ func (p AppAPIPreferences) ocsClient() OCSClient {
|
||||
}
|
||||
|
||||
// Get loads the configured preference key for the requesting user.
|
||||
// A missing key returns an empty string and a nil error.
|
||||
// It returns an error when the OCS call fails or the body cannot be decoded.
|
||||
func (p AppAPIPreferences) Get() (string, error) {
|
||||
ocs := p.ocsClient()
|
||||
body, _ := json.Marshal(map[string]any{"configKeys": []string{p.Key}})
|
||||
@@ -49,6 +51,8 @@ func (p AppAPIPreferences) Get() (string, error) {
|
||||
}
|
||||
|
||||
// Set stores value for the configured preference key.
|
||||
// The value is stored as non-sensitive.
|
||||
// It returns an error when the OCS call fails.
|
||||
func (p AppAPIPreferences) Set(value string) error {
|
||||
ocs := p.ocsClient()
|
||||
body, _ := json.Marshal(map[string]any{
|
||||
|
||||
Reference in New Issue
Block a user