storage

package
v0.0.0-...-5c5b187 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanWhitespaces

func CleanWhitespaces(b []byte) []byte

CleanWhitespaces - Replaces character series of space \n, \t, \f, \r into a single space or newline (when the serie contained a \n or \r).

Types

type Option

type Option func(*options)

Option - Storage option setter.

func WithCacheCleanupInterval

func WithCacheCleanupInterval(cleanupInterval time.Duration) Option

WithCacheCleanupInterval - Sets cache cleanup interval.

func WithCacheExpiration

func WithCacheExpiration(cacheExpiration time.Duration) Option

WithCacheExpiration - Sets cache expiration.

func WithDir

func WithDir(dirname string) Option

WithDir - Sets storage directory.

func WithWhitespaceRemoval

func WithWhitespaceRemoval(removeWhitespace bool) Option

WithWhitespaceRemoval - Enables total whitespaces removal (only repeated).

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage - Components storage.

func New

func New(opts ...Option) (s *Storage, err error)

New - Creates new components storage.

func (*Storage) Close

func (s *Storage) Close() (err error)

Close - Destroys caches and stops watching for changes.

func (*Storage) Component

func (s *Storage) Component(name string) (c *components.Component, err error)

Component - Returns component by name.

func (*Storage) FlushCache

func (s *Storage) FlushCache()

FlushCache - Flushes storage cache.

func (*Storage) Template

func (s *Storage) Template(path string) (t template.Template, err error)

Template - Compiles template by file path and saves in cache. Returns cached template if already compiled and not changed.

func (*Storage) Text

func (s *Storage) Text(path string) (t template.Template, err error)

Text - Returns file content as Template interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL