Documentation ¶
Index ¶
- Variables
- func File(tpl, sourceFile, packageName string) ([]byte, error)
- func Src(tpl, sourcePath string, source []byte, packageName string) ([]byte, error)
- type FileData
- type FuncValue
- type FunctionDeclaration
- func (f FunctionDeclaration) HasParams() bool
- func (f FunctionDeclaration) HasReturn() bool
- func (f FunctionDeclaration) ParamsNames() string
- func (f FunctionDeclaration) ResultFields() string
- func (f FunctionDeclaration) ResultFirstFieldDefaultValue() string
- func (f FunctionDeclaration) ResultFirstFieldType() string
- func (f FunctionDeclaration) ResultStructFields() string
- func (f FunctionDeclaration) ResultStructType() string
- func (f FunctionDeclaration) ResultStructVarName() string
- func (f FunctionDeclaration) SignatureWithPrefix(prefix string) string
- func (f FunctionDeclaration) SyncOnceVarName() string
- func (f FunctionDeclaration) WantReturn() bool
- func (f FunctionDeclaration) WantSyncOnce() bool
- type MemoizeOption
- type Memoizer
- type PackageImport
Constants ¶
This section is empty.
Variables ¶
View Source
var PackageTemplate string
Functions ¶
Types ¶
type FileData ¶
type FileData struct { PackageName string SourcePackage string Imports []PackageImport Functions []FunctionDeclaration }
type FuncValue ¶
func (FuncValue) ResultName ¶
type FunctionDeclaration ¶
type FunctionDeclaration struct { SourcePackage string IsExported bool Name string Params []FuncValue Results []FuncValue Signature string }
func (FunctionDeclaration) HasParams ¶
func (f FunctionDeclaration) HasParams() bool
func (FunctionDeclaration) HasReturn ¶
func (f FunctionDeclaration) HasReturn() bool
func (FunctionDeclaration) ParamsNames ¶
func (f FunctionDeclaration) ParamsNames() string
func (FunctionDeclaration) ResultFields ¶
func (f FunctionDeclaration) ResultFields() string
func (FunctionDeclaration) ResultFirstFieldDefaultValue ¶
func (f FunctionDeclaration) ResultFirstFieldDefaultValue() string
func (FunctionDeclaration) ResultFirstFieldType ¶
func (f FunctionDeclaration) ResultFirstFieldType() string
func (FunctionDeclaration) ResultStructFields ¶
func (f FunctionDeclaration) ResultStructFields() string
func (FunctionDeclaration) ResultStructType ¶
func (f FunctionDeclaration) ResultStructType() string
func (FunctionDeclaration) ResultStructVarName ¶
func (f FunctionDeclaration) ResultStructVarName() string
func (FunctionDeclaration) SignatureWithPrefix ¶
func (f FunctionDeclaration) SignatureWithPrefix(prefix string) string
func (FunctionDeclaration) SyncOnceVarName ¶
func (f FunctionDeclaration) SyncOnceVarName() string
func (FunctionDeclaration) WantReturn ¶
func (f FunctionDeclaration) WantReturn() bool
func (FunctionDeclaration) WantSyncOnce ¶
func (f FunctionDeclaration) WantSyncOnce() bool
type MemoizeOption ¶
func WithMaxSize ¶
func WithMaxSize(size int) MemoizeOption
type Memoizer ¶
type Memoizer struct {
// contains filtered or unexported fields
}
func New ¶
func New(options ...MemoizeOption) (*Memoizer, error)
type PackageImport ¶
Directories ¶
Path | Synopsis |
---|---|
gen
|
|
generic
this small cli tool is specific for those functions with arbitrary parameters and with result-error tuple as return values func(x,y) => result, error it works by creating a new memoized version of the functions in the same path as memo.original.file.go some parts are specific for nuclei and hardcoded within the template
|
this small cli tool is specific for those functions with arbitrary parameters and with result-error tuple as return values func(x,y) => result, error it works by creating a new memoized version of the functions in the same path as memo.original.file.go some parts are specific for nuclei and hardcoded within the template |
Package singleflight provides a duplicate function call suppression mechanism.
|
Package singleflight provides a duplicate function call suppression mechanism. |
Click to show internal directories.
Click to hide internal directories.