Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flag ¶
Flag defines an external plugin specification passed over the command line.
Plugin specifications received over the command line are simply plugin names followed by arguments for the plugin.
An executable with the name thriftrw-plugin-$name is expected on the $PATH. Remaining arguments are passed to the program. For example,
-p "foo -a --bc"
Will pass the arguments "-a --bc" to the executable "thriftrw-plugin-foo".
func (*Flag) Handle ¶
Handle gets a Handle to this plugin specification.
The returned handle MUST be closed by the caller if error was nil.
func (*Flag) UnmarshalFlag ¶
UnmarshalFlag parses a string specification of a plugin.
type Flags ¶
type Flags []Flag
Flags is a collection of ThriftRW external plugin specifications.
func (Flags) Handle ¶
func (fs Flags) Handle() (MultiHandle, error)
Handle gets a MultiHandle to all the plugins in this list or nil if the list is empty.
The returned handle MUST be closed by the caller if error was nil.
type Handle ¶
type Handle interface { io.Closer // ServiceGenerator returns a ServiceGenerator for this plugin or nil if // this plugin does not implement that feature. // // Note that the ServiceGenerator is valid only as long as Close is not // called on the Handle. ServiceGenerator() api.ServiceGenerator }
Handle is a handle to ThriftRW plugin.
type MultiHandle ¶
MultiHandle wraps a collection of handles into a single handle.
func (MultiHandle) Close ¶
func (mh MultiHandle) Close() error
Close closes all Handles associated with this MultiHandle.
func (MultiHandle) ServiceGenerator ¶
func (mh MultiHandle) ServiceGenerator() api.ServiceGenerator
ServiceGenerator returns a ServiceGenerator which calls into the ServiceGenerators of all plugins associated with this MultiHandle and consolidates their results.
type MultiServiceGenerator ¶
type MultiServiceGenerator map[string]api.ServiceGenerator
MultiServiceGenerator wraps a collection of ServiceGenerators into a single ServiceGenerator.
func (MultiServiceGenerator) Generate ¶
func (msg MultiServiceGenerator) Generate(req *api.GenerateServiceRequest) (*api.GenerateServiceResponse, error)
Generate calls all the service generators associated with this plugin and consolidates their output.
Any conflicts in the generated files will result in a failure.