Documentation ¶
Index ¶
- type FileSystemRegistry
- func (fsr *FileSystemRegistry) LinkHandler(fh sprout.Handler) error
- func (fsr *FileSystemRegistry) OsBase(value string) string
- func (fsr *FileSystemRegistry) OsClean(value string) string
- func (fsr *FileSystemRegistry) OsDir(value string) string
- func (fsr *FileSystemRegistry) OsExt(value string) string
- func (fsr *FileSystemRegistry) OsIsAbs(value string) bool
- func (fsr *FileSystemRegistry) PathBase(value string) string
- func (fsr *FileSystemRegistry) PathClean(value string) string
- func (fsr *FileSystemRegistry) PathDir(value string) string
- func (fsr *FileSystemRegistry) PathExt(value string) string
- func (fsr *FileSystemRegistry) PathIsAbs(value string) bool
- func (fsr *FileSystemRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
- func (fsr *FileSystemRegistry) UID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystemRegistry ¶
type FileSystemRegistry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *FileSystemRegistry
NewRegistry creates a new instance of filesystem registry.
func (*FileSystemRegistry) LinkHandler ¶
func (fsr *FileSystemRegistry) LinkHandler(fh sprout.Handler) error
LinkHandler links the handler to the registry at runtime.
func (*FileSystemRegistry) OsBase ¶
func (fsr *FileSystemRegistry) OsBase(value string) string
OsBase returns the last element of the path, using the OS-specific path separator.
Parameters:
value string - the path string.
Returns:
string - the base element of the path.
For an example of this function in a Go template, refer to Sprout Documentation: osBase.
func (*FileSystemRegistry) OsClean ¶
func (fsr *FileSystemRegistry) OsClean(value string) string
OsClean cleans up the path, using the OS-specific path separator and simplifying redundancies.
Parameters:
value string - the path string.
Returns:
string - the cleaned path.
For an example of this function in a Go template, refer to Sprout Documentation: osClean.
func (*FileSystemRegistry) OsDir ¶
func (fsr *FileSystemRegistry) OsDir(value string) string
OsDir returns all but the last element of the path, using the OS-specific path separator.
Parameters:
value string - the path string.
Returns:
string - the directory part of the path.
For an example of this function in a Go template, refer to Sprout Documentation: osDir.
func (*FileSystemRegistry) OsExt ¶
func (fsr *FileSystemRegistry) OsExt(value string) string
OsExt returns the file extension of the path, using the OS-specific path separator.
Parameters:
value string - the path string.
Returns:
string - the extension of the file in the path.
For an example of this function in a Go template, refer to Sprout Documentation: osExt.
func (*FileSystemRegistry) OsIsAbs ¶
func (fsr *FileSystemRegistry) OsIsAbs(value string) bool
OsIsAbs checks if the path is absolute, using the OS-specific path separator.
Parameters:
value string - the path string.
Returns:
bool - true if the path is absolute, otherwise false.
For an example of this function in a Go template, refer to Sprout Documentation: osIsAbs.
func (*FileSystemRegistry) PathBase ¶
func (fsr *FileSystemRegistry) PathBase(value string) string
PathBase returns the last element of the path.
Parameters:
value string - the path string.
Returns:
string - the base element of the path.
For an example of this function in a Go template, refer to Sprout Documentation: pathBase.
func (*FileSystemRegistry) PathClean ¶
func (fsr *FileSystemRegistry) PathClean(value string) string
PathClean cleans up the path, simplifying any redundancies like double slashes.
Parameters:
value string - the path string.
Returns:
string - the cleaned path.
For an example of this function in a Go template, refer to Sprout Documentation: pathClean.
func (*FileSystemRegistry) PathDir ¶
func (fsr *FileSystemRegistry) PathDir(value string) string
PathDir returns all but the last element of the path, effectively the path's directory.
Parameters:
value string - the path string.
Returns:
string - the directory part of the path.
For an example of this function in a Go template, refer to Sprout Documentation: pathDir.
func (*FileSystemRegistry) PathExt ¶
func (fsr *FileSystemRegistry) PathExt(value string) string
PathExt returns the file extension of the path.
Parameters:
value string - the path string.
Returns:
string - the extension of the file in the path.
For an example of this function in a Go template, refer to Sprout Documentation: pathExt.
func (*FileSystemRegistry) PathIsAbs ¶
func (fsr *FileSystemRegistry) PathIsAbs(value string) bool
PathIsAbs checks if the path is absolute.
Parameters:
value string - the path string.
Returns:
bool - true if the path is absolute, otherwise false.
For an example of this function in a Go template, refer to Sprout Documentation: pathIsAbs.
func (*FileSystemRegistry) RegisterFunctions ¶
func (fsr *FileSystemRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
RegisterFunctions registers all functions of the registry.
func (*FileSystemRegistry) UID ¶
func (fsr *FileSystemRegistry) UID() string
UID returns the unique identifier of the registry.