Documentation ¶
Overview ¶
Package adapter holds all code dedicated to side-effects and communication with the outside world (databse, os, filesystem, REST API, etc.). The domain MUST NEVER depend on adapters, always the reverse: the adapters depend on the domain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOSFileSystem ¶
func NewOSFileSystem(dirFS fs.FS, pathJoiner PathJoiner) music.MusicLibraryFileSystem
NewOSFileSystem creates a new OSFileSystem
Types ¶
type AssetsResolver ¶
AssetsResolver reads the manifest.json file in the /assets directory It is used by templates to resolve asset URIs with chunkhashes in their names. For example, it translates "style.css" to "/assets/style-caf5894036274013394c.css". It returns an error if it can't find the manifest file or can't decode its contents from JSON or can't find the given baseName in the manifest contents
func NewAssetsResolver ¶
func NewAssetsResolver(fs fs.FS, assetsBaseURI string) AssetsResolver
NewAssetsResolver creates a new AssetsResolver
type PathJoiner ¶
PathJoiner joins the given relative path to its base path
func NewBasePathJoiner ¶
func NewBasePathJoiner(basePath string) PathJoiner
NewBasePathJoiner creates a new PathJoiner
type TemplateExecutor ¶
type TemplateExecutor interface {
Load(writer io.Writer, data interface{}, templatePaths ...string) error
}
TemplateExecutor resolves the given relative template paths from the templates/ folder, parses the templates from the resolved files and executes them on the given writer. It returns an error if a template can't be found or if the execution fails.
func NewTemplateExecutor ¶
func NewTemplateExecutor(basePath string) TemplateExecutor
NewTemplateExecutor creates a new TemplateExecutor
Directories ¶
Path | Synopsis |
---|---|
Package rest implements the REST API.
|
Package rest implements the REST API. |
Package server implements the music server.
|
Package server implements the music server. |
app
Package app groups together app routes.
|
Package app groups together app routes. |
user
Package user groups together user authentication code.
|
Package user groups together user authentication code. |