Documentation ¶
Index ¶
- Constants
- func CompVersion(v1, v2 string) (int, error)
- func Crypto(v []byte, key []byte) ([]byte, error)
- func CryptoToBase64(v []byte, key []byte) (string, error)
- func Decrypto(v []byte, key []byte) ([]byte, error)
- func DecryptoFromBase64(v string, key []byte) ([]byte, error)
- func Exists(name string) bool
- func ForceColor() bool
- func GenCryptoKey(base string) []byte
- func GenCryptoKeyWithBytes(base []byte) []byte
- func GetEnvFiles(root string) ([]string, error)
- func GetPageAndMax(ctx *gin.Context) (page int, max int, err error)
- func GetPageItems[T any](items []T, page, pageSize int) []T
- func GetPageItemsRange(total, page, pageSize int) (start, end int)
- func GetUrlExtension(u string) string
- func HttpCookieToMap(c []*http.Cookie) map[string]string
- func In[T comparable](items []T, item T) bool
- func Index[T comparable](items []T, item T) int
- func IsLocalIP(address string) bool
- func LIKE(s string) string
- func MapToHttpCookie(m map[string]string) []*http.Cookie
- func NoRedirectHttpClient() *http.Client
- func OptFilePath(filePath string) (string, error)
- func ParseURLIsLocalIP(u string) (bool, error)
- func RandBytes(n int) []byte
- func RandString(n int) string
- func ReadYaml(file string, module any) error
- func SortUUID() string
- func SortUUIDWithUUID(src uuid.UUID) string
- func SplitVersion(v string) ([]int, error)
- func TruncateByRune(s string, length int) string
- func WriteYaml(file string, module any) error
- type Once
- type UpgraderConf
- type WebSocket
- type WebSocketConfig
Constants ¶
View Source
const ( VersionEqual = iota VersionGreater VersionLess )
View Source
const (
UA = `` /* 135-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
func CompVersion ¶ added in v0.2.4
func DecryptoFromBase64 ¶ added in v0.3.1
func ForceColor ¶ added in v0.3.1
func ForceColor() bool
func GenCryptoKey ¶ added in v0.3.1
func GenCryptoKeyWithBytes ¶ added in v0.3.1
func GetEnvFiles ¶ added in v0.4.2
func GetPageAndMax ¶ added in v0.3.1
func GetPageItems ¶
func GetPageItemsRange ¶ added in v0.3.0
func GetUrlExtension ¶ added in v0.3.0
func In ¶
func In[T comparable](items []T, item T) bool
func Index ¶
func Index[T comparable](items []T, item T) int
func NoRedirectHttpClient ¶ added in v0.3.0
func OptFilePath ¶ added in v0.3.0
func ParseURLIsLocalIP ¶ added in v0.3.0
func RandString ¶
func SortUUIDWithUUID ¶ added in v0.3.2
func SplitVersion ¶ added in v0.2.4
func TruncateByRune ¶ added in v0.3.5
Types ¶
type UpgraderConf ¶
func WithSubprotocols ¶
func WithSubprotocols(Subprotocols []string) UpgraderConf
type WebSocket ¶
func DefaultWebSocket ¶
func DefaultWebSocket() *WebSocket
func NewWebSocketServer ¶
func NewWebSocketServer(conf ...WebSocketConfig) *WebSocket
func (*WebSocket) NewWebSocketClient ¶
type WebSocketConfig ¶
type WebSocketConfig func(*WebSocket)
func WithHeartbeatInterval ¶
func WithHeartbeatInterval(d time.Duration) WebSocketConfig
Click to show internal directories.
Click to hide internal directories.