Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { Dir string `env:"RB_STATIC_DIR" envDefault:"."` StaticPathPrefix string `env:"RB_ASSET_STATIC_PATH_PREFIX" envDefault:"/static/"` }
Conf configurest static file handler
type StaticFiles ¶
StaticFiles provides files for the static ware
func FromDir ¶
func FromDir(logs *zap.Logger, cfg Conf) StaticFiles
FromDir provides template files from an actual directory
func FromEmbed ¶
func FromEmbed(efs embed.FS) StaticFiles
FromEmbed creates a template files fs from an embedded filesystem
type StaticWare ¶
StaticWare is middleware that shows static files for a certain prefix
func NewStatic ¶
func NewStatic(logs *zap.Logger, cfg Conf, sfs StaticFiles) StaticWare
NewStatic returns a static file handler configured on the prefix
Click to show internal directories.
Click to hide internal directories.