Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶ added in v0.1.1
Generate generates service interfaces to be used for generating mocks. The clients passed in as the first argument should be structs that will be used to generate the service interfaces. The second argument, dir, is the path to the output directory where the service interface files will be created.
func MethodHasAnyPrefix ¶
MethodHasAnyPrefix returns true if the method name has any of the given prefixes.
Types ¶
type Option ¶
type Option func(*Options)
func WithExtraImports ¶ added in v0.2.0
func WithSinglePackage ¶ added in v0.3.4
type Options ¶
type Options struct { // ShouldInclude tests whether a method should be included in the generated interfaces. If it returns true, // the method will be included. MethodHasPrefix and MethodHasSuffix can be used inside a custom function here // to customize the behavior. ShouldInclude func(reflect.Method) bool // ExtraImports can add extra imports for a method ExtraImports func(reflect.Method) []string // SinglePackage allows to generate all passed clients into a single package. // The clients will get their package name as prefix to the interface name (e.g., s3.Client -> S3Client) SinglePackage string }
func (*Options) SetDefaults ¶
func (o *Options) SetDefaults()
Click to show internal directories.
Click to hide internal directories.