Skip to content

evillemez/grotto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo does nothing useful. These are just first experiments with both otto and golang.

TODO:

  • Next step, use Negroni to add some middleware like logging

  • serve some static templates

  • serve some static assets (css)

  • create some structs for models

  • persist models to db:

  • expose data manipulation via api

  • validation on maps maybe, or structs: https://github.com/asaskevich/govalidator

  • write unit tests w/ help from: https://github.com/stretchr/testify

  • integration tests w/ help from: https://golang.org/pkg/net/http/httptest/

  • contemplate partial model updates & partial views

    • write a map transformer library, end result would be similar to JMS Serializer Groups, but applying transformation on intermediary map representation, not structs directly
    • call it mapblaster? :) Or more generic: mapview
    • theoretical example usage (don't know how possible it is yet):
      • mutate map by whitelisting/blacklisting object paths
        • transformedMap, err := maps.IncludePaths(someMap, {"some.path","another.path"})
        • transformedMap, err := maps.ExcludePaths(someMap, {"some.path","another.path"})
      • create and apply configurable views to a map
        • creating a view
          • var ApiView maps.MapView = maps.NewMapView(). SetExcludedPaths({"some.path"}). SetPathHandler("some.path", handlers.MyCustomPathHandler)
          • var SearchIndexView = maps.NewMapView(). Include(ApiView). AddRequiredPath("id"). AddExcludedPath("different.nested.path"). SetPathHandler("another.path", handlers.SomeHandler)
        • using a view
          • transformedMap, err := maps.ApplyMapView(someMap, ApiView)

About

Experiments with golang and otto

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published