impl

package
v0.0.0-...-c8bca78 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package impl writes scaffolding for the given interface using receiver as the receiver. The path is expected to be in the format of <package>.<interface>. It would be really helpful to look at the tests in impl_test.go for more use cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Impl

func Impl(path string, receiver string, w io.Writer) error

Impl is the main entry point for the impl package. It writes scaffolding for the given interface using receiver as the receiver. The path is expected to be in the format of <package>.<interface>. For example, "io.Reader" or "impl/test_data/panther.Clawable". By default it writes scaffolding for all methods of the interface. Optionally you could specify a single method to scaffold by writing its name at the end after "::" (e.g., "impl/impl/test_data/panther.Clawable::Hardness"). It would be really helpful to look at the tests in impl_test.go for more use cases.

Types

type CouldNotFindPackageError

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

func NewCouldNotFindPackageError

func NewCouldNotFindPackageError(message string, args ...interface{}) *CouldNotFindPackageError

func (*CouldNotFindPackageError) Error

func (e *CouldNotFindPackageError) Error() string

type EmptyInterfacePathError

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

func NewEmptyInterfacePathError

func NewEmptyInterfacePathError(message string, args ...interface{}) *EmptyInterfacePathError

func (*EmptyInterfacePathError) Error

func (e *EmptyInterfacePathError) Error() string

type Interface

type Interface struct {
	Methods []Method
}

func NewInterface

func NewInterface(m []Method) *Interface

type InterfaceNotFoundError

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

func NewInterfaceNotFoundError

func NewInterfaceNotFoundError(message string, args ...interface{}) *InterfaceNotFoundError

func (*InterfaceNotFoundError) Error

func (e *InterfaceNotFoundError) Error() string

type InvalidImportFormatError

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

func NewInvalidImportFormatError

func NewInvalidImportFormatError(message string, args ...interface{}) *InvalidImportFormatError

func (*InvalidImportFormatError) Error

func (e *InvalidImportFormatError) Error() string

type InvalidInterfacePathError

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

func NewInvalidInterfacePathError

func NewInvalidInterfacePathError(message string, args ...interface{}) *InvalidInterfacePathError

func (*InvalidInterfacePathError) Error

func (e *InvalidInterfacePathError) Error() string

type InvalidMethodNameError

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

func NewInvalidMethodNameError

func NewInvalidMethodNameError(message string, args ...interface{}) *InvalidMethodNameError

func (*InvalidMethodNameError) Error

func (e *InvalidMethodNameError) Error() string

type Method

type Method struct {
	Name string
	In   []Parameter
	Out  []Parameter
}

func NewMethod

func NewMethod(name string, in []Parameter, out []Parameter) Method

type NotAnInterfaceError

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

func NewNotAnInterfaceError

func NewNotAnInterfaceError(message string, args ...interface{}) *NotAnInterfaceError

func (*NotAnInterfaceError) Error

func (e *NotAnInterfaceError) Error() string

type Parameter

type Parameter struct {
	Name string
	Type string
}

func NewParameter

func NewParameter(name, typeName string) Parameter

NewParameter creates a new parameter with the given name and type. An empty name creates an unnamed parameter, meant to be returned.

Jump to

Keyboard shortcuts

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