utils

package
v0.0.0-...-c4b7867 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecPath

func ExecPath() string

ExecPath 获取当前可执行文件的路径

func HomePath

func HomePath() string

ExecPath 获取当前Home目录的路径

Types

type BaseURL

type BaseURL string

func (*BaseURL) CheckOut

func (b *BaseURL) CheckOut() bool

CheckOut 检查是不是url链接

func (*BaseURL) GenerateURL

func (b *BaseURL) GenerateURL(urls ...string) string

GenerateURL 基于BaseURL生成url

type Result

type Result[T any] struct {
	Success bool    `json:"success"`
	Message *string `json:"message,omitempty"`
	Data    *T      `json:"data,omitempty"`
}

func Failed

func Failed[T any](msg string, data T) Result[T]

func FailedData

func FailedData[T any](data T) Result[T]

func FailedMsg

func FailedMsg(msg string) Result[types.Nil]

func Success

func Success[T any](msg string, data T) Result[T]

func SuccessData

func SuccessData[T any](data T) Result[T]

func SuccessMsg

func SuccessMsg(msg string) Result[types.Nil]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL