mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-11 17:47:20 +10:00
26 lines
559 B
Go
26 lines
559 B
Go
//go:build darwin
|
|
|
|
package ocm
|
|
|
|
func platformReadCredentials(customPath string) (*oauthCredentials, error) {
|
|
if customPath == "" {
|
|
var err error
|
|
customPath, err = getDefaultCredentialsPath()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return readCredentialsFromFile(customPath)
|
|
}
|
|
|
|
func platformWriteCredentials(credentials *oauthCredentials, customPath string) error {
|
|
if customPath == "" {
|
|
var err error
|
|
customPath, err = getDefaultCredentialsPath()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return writeCredentialsToFile(credentials, customPath)
|
|
}
|