Skip to content

danidiaz/dep-t-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dep-t-value

Pair resources files with types within your program.

Part of the dep-t-framework.

How to use

  • Take a datatype that you want to associate to a resource file, and derive a Dep.Resource.FromResource instance for it.

  • Make your program logic take a Value yourdatatype record.

  • When assembling the global application environment,

    • Use dataDirLoader to define a Loader that searches for resource files by following the datatype's module path, and uses the dataype's name as file name.

    • Build the Value yourdatatype by using functions form Dep.Value.JSON or Dep.Value.Text.

Links

The actual location of all these directories can be individually overridden at runtime using environment variables of the form pkg_name_var, where pkg_name is the name of the package with all hyphens converted into underscores, and var is either bindir, libdir, dynlibdir, datadir, libexedir or sysconfdir. For example, the configured data directory for pretty-show is controlled with the pretty_show_datadir environment variable.

About

Pair external resources with types within your program.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published