resource

package
v0.0.0-...-9740c7f Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource map[string]http.FileSystem

func New

func New() *Resource

func (*Resource) Bind

func (res *Resource) Bind(domain string, fileSystem interface{}) (err error)

Bind fileSystem to domain

FileSystem accept type of below

  • embed.FS
  • fs.FS
  • fs.SubFS
  • http.FileSystem
  • string of directory (The resource will not embed, you should copy the files to the target build directory)

func (*Resource) GetFile

func (res *Resource) GetFile(url string) http.File

func (*Resource) IsExist

func (res *Resource) IsExist(domain string) bool

func (*Resource) Unbind

func (res *Resource) Unbind(domain string)

Jump to

Keyboard shortcuts

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