Files
sing-box-extended-mirror/service/ccm/credential_other.go
T

28 lines
648 B
Go
Raw Normal View History

2026-05-13 22:37:05 +08:00
//go:build !darwin || !cgo
2025-10-21 10:34:05 +08:00
package ccm
2026-07-15 19:31:11 +08:00
import "context"
func platformReadCredentials(ctx context.Context, customPath string) (*oauthCredentials, error) {
2025-10-21 10:34:05 +08:00
if customPath == "" {
var err error
customPath, err = getDefaultCredentialsPath()
if err != nil {
return nil, err
}
}
2026-07-15 19:31:11 +08:00
return readCredentialsFromFile(ctx, customPath)
2025-10-21 10:34:05 +08:00
}
2026-07-15 19:31:11 +08:00
func platformWriteCredentials(ctx context.Context, oauthCredentials *oauthCredentials, customPath string) error {
2025-10-21 10:34:05 +08:00
if customPath == "" {
var err error
customPath, err = getDefaultCredentialsPath()
if err != nil {
return err
}
}
2026-07-15 19:31:11 +08:00
return writeCredentialsToFile(ctx, oauthCredentials, customPath)
2025-10-21 10:34:05 +08:00
}