Documentation
¶
Index ¶
- Constants
- func BodyToString(header http.Header, body []byte) string
- func BuildGetRequestURL(baseURL string, body []byte) (string, error)
- func CheckServiceIsExistInEnv(serviceName string) bool
- func Contains(slice []string, target string) bool
- func DecodeBase64(data string) ([]byte, error)
- func DetectGpuModel() string
- func DownloadFile(downloadURL string, saveDir string) (string, error)
- func DownloadImageUrlToPath(url string) (string, error)
- func FormatSecondsToSRT(secondsStr string) string
- func GenerateNonceString(n int) string
- func GenerateUUID() string
- func GetAOGDataDir() (string, error)
- func GetAbsolutePath(p string, base string) string
- func GetDownloadDir() (string, error)
- func GetGpuInfo() (int, error)
- func GetSystemVersion() int
- func GetUserDataDir() (string, error)
- func HmacSha1String(s, key string) string
- func HmacSha256(s, key string) string
- func HmacSha256String(s, key string) string
- func IpexOllamaSupportGPUStatus() bool
- func IsHTTPText(header http.Header) bool
- func IsServerRunning() bool
- func Min(a, b int) int
- func NowUnixMilli() int64
- func ParseImageData(data []byte) ([][]byte, error)
- func ParseRequestBody(reqBody []byte) (map[string]interface{}, error)
- func ParseSRTTimestamps(srtContent string) (*int, *int)
- func ParseSizeToGB(sizeStr string) float64
- func ParseTableOutput(output string) map[string]string
- func ParseTimestamp(timestamp string) int
- func ReadImageFileToBase64(filePath string) (string, error)
- func Sha256hex(s string) string
- func StartAOGServer(logPath string, pidFilePath string) error
- func StopAOGServer(pidFilePath string) error
- func SystemDiskSize(path string) (*types.PathDiskSizeInfo, error)
- func UnzipFile(zipFile, destDir string) error
- type MemoryInfo
- type SafeList
- func (sl *SafeList) Back() *list.Element
- func (sl *SafeList) Front() *list.Element
- func (sl *SafeList) InsertAfter(v any, mark *list.Element) *list.Element
- func (sl *SafeList) InsertBefore(v any, mark *list.Element) *list.Element
- func (l *SafeList) Len() int
- func (sl *SafeList) MoveAfter(e, mark *list.Element)
- func (sl *SafeList) MoveBefore(e, mark *list.Element)
- func (sl *SafeList) MoveToBack(e *list.Element)
- func (sl *SafeList) MoveToFront(e *list.Element)
- func (sl *SafeList) PushBack(v any) *list.Element
- func (sl *SafeList) PushFront(v any) *list.Element
- func (sl *SafeList) Remove(e *list.Element) any
Constants ¶
const ( // Content types ContentTypeJSON = "application/json" ContentTypeXML = "application/xml" ContentTypeJS = "application/javascript" ContentTypeNDJSON = "application/x-ndjson" ContentTypeText = "text/" // Time conversion constants SecondsPerMinute = 60 SecondsPerHour = 3600 MillisecondsPerSecond = 1000 // Default timestamp format DefaultSRTTime = "00:00:00,000" )
Variables ¶
This section is empty.
Functions ¶
func CheckServiceIsExistInEnv ¶
CheckServiceIsExistInEnv checks if service exists in environment variables
func DetectGpuModel ¶
func DetectGpuModel() string
func DownloadImageUrlToPath ¶
func FormatSecondsToSRT ¶
FormatSecondsToSRT 将秒数转换为SRT时间格式 (HH:MM:SS,mmm)
func GenerateNonceString ¶
func GetAOGDataDir ¶
func GetAbsolutePath ¶
GetAbsolutePath Convert relative path to absolute path from the passed in base directory No change if the passed in path is already an absolute path
func GetDownloadDir ¶
func GetGpuInfo ¶
func GetSystemVersion ¶
func GetSystemVersion() int
func GetUserDataDir ¶
func HmacSha1String ¶
func HmacSha256 ¶
func HmacSha256String ¶
func IpexOllamaSupportGPUStatus ¶
func IpexOllamaSupportGPUStatus() bool
func IsHTTPText ¶
func IsServerRunning ¶
func IsServerRunning() bool
func ParseImageData ¶
func ParseRequestBody ¶
func ParseSRTTimestamps ¶
func ParseSizeToGB ¶
func ParseTableOutput ¶
+-----------------------------+--------------------------------------------------------------------+ | Device ID | 0 | +-----------------------------+--------------------------------------------------------------------+ | GPU Utilization (%) | 0 | | EU Array Active (%) | | Analyze the output table content of the above terminal command
func ParseTimestamp ¶
ParseTimestamp 将 SRT 格式的时间戳 (00:00:00,000) 转换为毫秒
func ReadImageFileToBase64 ¶
func StartAOGServer ¶
func StopAOGServer ¶
func SystemDiskSize ¶
func SystemDiskSize(path string) (*types.PathDiskSizeInfo, error)
Types ¶
type MemoryInfo ¶
func GetMemoryInfo ¶
func GetMemoryInfo() (*MemoryInfo, error)
type SafeList ¶
type SafeList struct {
// contains filtered or unexported fields
}
func NewSafeList ¶
func NewSafeList() *SafeList