global

package
v0.0.0-...-5cc333d Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

utils

Index

Constants

This section is empty.

Variables

View Source
var (
	HttpClientTimeout = 10 * time.Second
	ConfigCache       syncx.Map[string, string]
	URLCache          syncx.Map[string, *model.LiveInfo]
	ChannelCache      syncx.Map[uint, model.Channel]
	M3U8Cache         = cache.New(3*time.Second, 10*time.Second)
)
View Source
var (
	ErrConfigNotFound    = errors.New("config key not found")
	ErrYoutubeDlNotFound = errors.New("Youtube-dl not found")
)
View Source
var DB *gorm.DB

Functions

func ClearSecretToken

func ClearSecretToken()

func GetAllCategories

func GetAllCategories() []string

func GetBaseURL

func GetBaseURL(rawURL string) string

func GetConfig

func GetConfig(key string) (string, error)

func GetLiveToken

func GetLiveToken() string

func GetSecretToken

func GetSecretToken() string

func InitDB

func InitDB(filepath string) (err error)

func IsValidURL

func IsValidURL(u string) bool

func MergeUrl

func MergeUrl(baseUrl string, partialUrl string) string

func SetConfig

func SetConfig(key, value string) error

func TransportWithProxy

func TransportWithProxy(proxyUrl string) *http.Transport

Types

This section is empty.

Jump to

Keyboard shortcuts

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