recdn

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Min added in v0.1.2

func Min(content string, loader api.Loader) string

func RemoveMin added in v0.1.2

func RemoveMin(input string) string

Types

type App

type App struct {
	Cache  cache.CacheDriver
	Config *AppConfig
}

App

func New

func New(config *AppConfig) (*App, error)

新建实例

func (*App) GitHub

func (a *App) GitHub(repo string, branch string, file string) (*File, error)

从GitHub获取文件

func (*App) Npm

func (a *App) Npm(pack string, version string, file string) (*File, error)

从Npm获取文件

type AppConfig

type AppConfig struct {
	Cache  cache.CacheConfig
	GitHub GitHubConfig
}

App配置

type File

type File struct {
	// 文件类型
	Type string

	// 文件内容
	Content interface{}
}

文件

func Fetch

func Fetch(path string) (*File, error)

func (*File) FromString

func (f *File) FromString(data string) error

从字符串加载文件

func (*File) String

func (f *File) String() (string, error)

将文件转换为字符串

type GitHubConfig

type GitHubConfig struct {
	Raw string
}

GitHub回源配置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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