Download internal/misc/credentials.go from shimen/API: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/spaces/shimen/API/resolve/main/internal/misc/credentials.go
- Command line
-
hf download hf://spaces/shimen/API/internal/misc/credentials.go
-
curl -L -o credentials.go https://huggingface.co/spaces/shimen/API/resolve/main/internal/misc/credentials.go
664 Bytes
| package misc | |
| import ( | |
| "fmt" | |
| "path/filepath" | |
| "strings" | |
| log "github.com/sirupsen/logrus" | |
| ) | |
| // Separator used to visually group related log lines. | |
| var credentialSeparator = strings.Repeat("-", 67) | |
| // LogSavingCredentials emits a consistent log message when persisting auth material. | |
| func LogSavingCredentials(path string) { | |
| if path == "" { | |
| return | |
| } | |
| // Use filepath.Clean so logs remain stable even if callers pass redundant separators. | |
| fmt.Printf("Saving credentials to %s\n", filepath.Clean(path)) | |
| } | |
| // LogCredentialSeparator adds a visual separator to group auth/key processing logs. | |
| func LogCredentialSeparator() { | |
| log.Debug(credentialSeparator) | |
| } | |