package step import "html/template" // Provider is an object which provides extra functionality to an environment. type Provider interface { // Package returns the package identifier of the provider. For example: // git.tebibyte.media/sashakoshka/step/examples/testplugin. The only // exception is providers within the providers sub-package, which just // return their basename. Package () string } // Configurable is an object that can be configured according to metadata. type Configurable interface { Provider // Configure uses config to configure the object. It must not modify // config. Keys are namespaced with a '.' and are written in kebab case. Configure (config Meta) error } // ConfigProcessor is an object that can alter the environment configuration // before other providers are configured in order to provide a sort of macro // system. type ConfigProcessor interface { // ProcessConfig analyzes and makes necessary changes to config. Unlike // Configurable.Configure, it can modify config. ProcessConfig (config Meta) error } // Trimmer is an object that needs to be routinely "trimmed". This can be // garbage collecting, sanity checking, etc. type Trimmer interface { // Trim trims the object. It must not block for any significant length // of time. It should be called every minute or so. Trim () } // Initializer is an object that must be initialized before first use. type Initializer interface { Init () error } // FuncProvider provides a template.FuncMap. type FuncProvider interface { Provider // FuncMap provides a template.FuncMap. It may return nil, in which case // its result is simply not considered. FuncMap () template.FuncMap } // FuncProviderFor is an object that provides a template.FuncMap for a specific // document. type FuncProviderFor interface { Provider // FuncMap provides a template.FuncMap, given a particular document. It // may return nil, in which case its result is simply not considered. FuncMapFor (*Document) template.FuncMap }