env

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchURL added in v0.0.31

func FetchURL(url string) ([]byte, error)

FetchURL retrieves content from a URL using JavaScript's fetch API Returns the content as []byte and an error if the request fails

func FileExists added in v0.0.31

func FileExists(pathOrContent any) ([]byte, error)

FileExists checks if a file exists and returns its contents. Accepts string (path/URL) or []byte (content). In frontend environment: - If given a URL, it will fetch the content using JavaScript fetch API - If given local file path, it warns that direct access is not supported - If given []byte, it returns the content directly

func SetupDefaultFileWriter

func SetupDefaultFileWriter() func(filename string, data []byte) error

func SetupDefaultLogger

func SetupDefaultLogger() func(a ...any)

SetupDefaultLogger configures the default logger for frontend environments

Types

This section is empty.

Jump to

Keyboard shortcuts

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