{"modulePath":"github.com/cloudquery/codegen","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package interfaces\n\n## Functions\n\n```go\nfunc Generate(clients []any, dir string, opts ...Option) error\n```\nGenerate 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.\n\n```go\nfunc MethodHasAnyPrefix(m reflect.Method, prefixes []string) bool\n```\nMethodHasAnyPrefix returns true if the method name has any of the given prefixes.\n\n```go\nfunc MethodHasAnySuffix(m reflect.Method, suffixes []string) bool\n```\nMethodHasAnySuffix returns true if the method name has any of the given suffixes.\n\n## Types\n\n```go\ntype Option func(*Options)\n```\n\n```go\nfunc WithExtraImports(f func(reflect.Method) []string) Option\n```\n\n```go\nfunc WithIncludeFunc(f func(reflect.Method) bool) Option\n```\n\n```go\nfunc WithSinglePackage(name string) Option\n```\n\n```go\ntype Options struct {\n\t// ShouldInclude tests whether a method should be included in the generated interfaces. If it returns true,\n\t// the method will be included. MethodHasPrefix and MethodHasSuffix can be used inside a custom function here\n\t// to customize the behavior.\n\tShouldInclude func(reflect.Method) bool\n\n\t// ExtraImports can add extra imports for a method\n\tExtraImports func(reflect.Method) []string\n\n\t// SinglePackage allows to generate all passed clients into a single package.\n\t// The clients will get their package name as prefix to the interface name (e.g., s3.Client -\u003e S3Client)\n\tSinglePackage string\n}\n```\n\n```go\nfunc (o *Options) SetDefaults()\n```\n\n","path":"github.com/cloudquery/codegen/interfaces","name":"interfaces","synopsis":"","isRedistributable":true}
