Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPluginDir ¶
func GetPluginDir() string
func PrintOut ¶
func PrintOut(input *ConvInput, output *ConvOutput)
func PrintUsage ¶
func PrintUsage()
Types ¶
type ConvInput ¶
type ConvInput struct { Value string FromUnit string ToUnit string Context string Verbose bool Raw bool }
func (*ConvInput) ToPluginInput ¶
func (in *ConvInput) ToPluginInput(flags map[string]string) *PluginInput
type ConvOutput ¶
func (*ConvOutput) Raw ¶
func (out *ConvOutput) Raw() string
func (*ConvOutput) String ¶
func (out *ConvOutput) String() string
func (*ConvOutput) Verbose ¶
func (out *ConvOutput) Verbose() string
type ConvPlugin ¶
type ConvPlugin interface { Run(in *PluginInput) (*PluginOutput, error) Context() string Units() []string }
type PluginInput ¶
type PluginOutput ¶
type PluginStorage ¶
type PluginStorage struct { Plugins map[string]ConvPlugin Units map[string]string }
func LoadPlugins ¶
func LoadPlugins(pluginDir string) *PluginStorage
func (*PluginStorage) SendToPlugin ¶
func (pluginStorage *PluginStorage) SendToPlugin(input *ConvInput) (*ConvOutput, error)
Click to show internal directories.
Click to hide internal directories.