Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndPointFromCacheService ¶
func EndPointFromCacheService(s CacheService) endpoint.Endpoint
Types ¶
type CacheService ¶
type CacheService interface { // On success returns the render result from the cache at input key, returns error != nil if failed Get(CacheKey) (string, error) // Maps input key to input render result inside the cache, returns error != nil if failed Set(CacheKey, string) error }
Stores render results, which can be set/retrieved via a CacheKey
func CacheServiceFromEndpoint ¶
func CacheServiceFromEndpoint(ctx context.Context, e endpoint.Endpoint) CacheService
type RenderService ¶
type RenderService interface { // Uses html/template to render the input context with the given schema, writes result to input writer // // Returns error != nil if failed Render(string, models.Schema, io.Writer) error }
func NewRenderService ¶
func NewRenderService(cache CacheService) RenderService
Returns default implementation of a RenderService, using a cache.
type RenderServiceMiddleware ¶
type RenderServiceMiddleware func(RenderService) RenderService
Chainable behavior modifier for RenderService.
Click to show internal directories.
Click to hide internal directories.