Documentation
¶
Index ¶
- Variables
- func BadRequest(c *fiber.Ctx, message string) error
- func CleanHTML(raw string) string
- func Contains(slice []string, item string) bool
- func Created(c *fiber.Ctx, message string, data interface{}) error
- func ErrorResponse(c *fiber.Ctx, statusCode int, message string) error
- func ExtractDataID(id string) string
- func Forbidden(c *fiber.Ctx, message string) error
- func FormatDuration(d time.Duration) string
- func FormatTime(t time.Time) string
- func FormatTimeString(t time.Time) string
- func FormatTitle(title string, dataID string) string
- func GenerateID() string
- func GenerateSlug(s string) string
- func GetAppStartTime() time.Time
- func GetBaseProviders() []string
- func GetFallback1Host() string
- func GetFallback1URL() string
- func GetFallback2Host() string
- func GetFallback2URL() string
- func GetFallbackStreams() []string
- func GetStreamProvider() string
- func GetStreamProviderHost() string
- func GetUptime() time.Duration
- func GetUptimeString() string
- func GetV1BaseHost() string
- func GetV1BaseURL() string
- func GetV2BaseHost() string
- func GetV2BaseURL() string
- func GetV3BaseHost() string
- func GetV3BaseURL() string
- func GetV4BaseHost() string
- func GetV4BaseURL() string
- func InternalServerError(c *fiber.Ctx, message string) error
- func IsValidFallbackStream(stream string) bool
- func IsValidProvider(provider string) bool
- func NewCollector() *colly.Collector
- func NotFound(c *fiber.Ctx, message string) error
- func Now() time.Time
- func OK(c *fiber.Ctx, message string, data interface{}) error
- func PaginatedResponse(c *fiber.Ctx, statusCode int, message string, data interface{}, ...) error
- func ParseTime(s string) (time.Time, error)
- func PointerToString(s *string) string
- func SetAppStartTime(t time.Time)
- func StringToPointer(s string) *string
- func SuccessResponse(c *fiber.Ctx, statusCode int, message string, data interface{}) error
- func TruncateString(s string, maxLen int) string
- func Unauthorized(c *fiber.Ctx, message string) error
- func Unique(slice []string) []string
- func UnprocessableEntity(c *fiber.Ctx, message string) error
- type Providers
- type Response
Constants ¶
This section is empty.
Variables ¶
var ( // BaseProviders are the main anime providers BaseProviders = []string{ baseV1Host, baseV2Host, baseV3Host, baseV4Host, } // FallbackStreams are fallback stream providers FallbackStreams = []string{ fallback1Host, fallback2Host, } )
Functions ¶
func BadRequest ¶
BadRequest sends a 400 Bad Request response
func CleanHTML ¶
CleanHTML takes the raw JSON-escaped HTML from the AJAX response and returns clean, proper HTML that goquery can parse.
func ErrorResponse ¶
ErrorResponse sends an error response
func ExtractDataID ¶
ExtractDataID get the numeric id from the dataid
func FormatDuration ¶
FormatDuration formats a duration to a human-readable string
func FormatTimeString ¶
FormatTimeString formats a time string to RFC3339 format
func FormatTitle ¶
func GenerateSlug ¶
GenerateSlug generates a URL-friendly slug from a string
func GetAppStartTime ¶
func GetFallback1Host ¶
func GetFallback1Host() string
GetFallback1Host returns the primary fallback host
func GetFallback1URL ¶
func GetFallback1URL() string
GetFallback1URL returns the primary fallback URL with https scheme
func GetFallback2Host ¶
func GetFallback2Host() string
GetFallback2Host returns the secondary fallback host
func GetFallback2URL ¶
func GetFallback2URL() string
GetFallback2URL returns the secondary fallback URL with https scheme
func GetFallbackStreams ¶
func GetFallbackStreams() []string
GetFallbackStreams returns fallback stream providers
func GetStreamProvider ¶
func GetStreamProvider() string
GetStreamProvider returns the main stream provider with https scheme
func GetStreamProviderHost ¶
func GetStreamProviderHost() string
GetStreamProviderHost returns the raw stream provider host
func GetUptimeString ¶
func GetUptimeString() string
func GetV1BaseURL ¶
func GetV1BaseURL() string
GetV1BaseURL returns the v1 provider URL with https scheme
func GetV2BaseURL ¶
func GetV2BaseURL() string
GetV2BaseURL returns the v2 provider URL with https scheme
func GetV3BaseURL ¶
func GetV3BaseURL() string
GetV3BaseURL returns the v3 provider URL with https scheme
func GetV4BaseURL ¶
func GetV4BaseURL() string
GetV4BaseURL returns the v4 provider URL with https scheme
func InternalServerError ¶
InternalServerError sends a 500 Internal Server Error response
func IsValidFallbackStream ¶
IsValidFallbackStream checks if a fallback stream is valid
func IsValidProvider ¶
IsValidProvider checks if a provider is valid
func NewCollector ¶
NewCollector returns a preconfigured colly Collector with sane defaults
func PaginatedResponse ¶
func PaginatedResponse(c *fiber.Ctx, statusCode int, message string, data interface{}, meta interface{}) error
PaginatedResponse sends a paginated response
func PointerToString ¶
PointerToString converts a string pointer to a string
func SetAppStartTime ¶
func StringToPointer ¶
StringToPointer converts a string to a string pointer
func SuccessResponse ¶
SuccessResponse sends a success response
func TruncateString ¶
TruncateString truncates a string to a maximum length
func Unauthorized ¶
Unauthorized sends a 401 Unauthorized response