sdload

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sdload 从文件或远程加载数据

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(loc string) ([]byte, error)

func JSON

func JSON[T any](loc string) (T, error)

func RegisterLoader

func RegisterLoader(scheme string, loader Loader)

func TOML

func TOML[T any](loc string) (T, error)

func Text

func Text(loc string) (string, error)

func TextDef

func TextDef(loc, def string) string

func YAML

func YAML[T any](loc string) (T, error)

Types

type Loader

type Loader interface {
	LoadBytes(loc string) ([]byte, error)
}

type LoaderFunc

type LoaderFunc func(loc string) ([]byte, error)

func (LoaderFunc) LoadBytes

func (f LoaderFunc) LoadBytes(loc string) ([]byte, error)

Jump to

Keyboard shortcuts

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