variadic

package
v0.0.0-...-15a9106 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Variadic

type Variadic struct {

	// Template embeds the default logic of the template framework.
	*codegen.Template
	// contains filtered or unexported fields
}

Variadic is a template that translates code into a set of variadic implementations with generic type parameters.

It supports the following pipelines:

+---------------+----------+------------------------------------------------------------+---------------------------+ | Pipeline | Type | Description | Example Output | +---------------+----------+------------------------------------------------------------+---------------------------+ | hasParams | bool | true if the currently generated variadic has parameters. | true | | paramCount | int | the current number of variadic parameters. | 2 | | params | string | the current list of variadic parameters (without types). | i.e. "arg1, arg2" | | typedParams | string | the current list of variadic parameters (including types). | i.e. "arg1 T1, arg2 T2" | | types | string | the current list of variadic types. | i.e. "T1, T2" | +---------------+----------+------------------------------------------------------------+---------------------------+

func New

func New() *Variadic

New creates a new Variadic template.

func (*Variadic) Generate

func (v *Variadic) Generate(fileName string, minParamCount, maxParamCount int, optGenerator ...func() (string, error)) error

Generate generates a file containing the desired number of variadic instances (it can receive an optional generator function that overrides the way the Content is generated).

func (*Variadic) GenerateContent

func (v *Variadic) GenerateContent() (string, error)

GenerateContent generates multiple variadic instances of the template according to the current configuration.

Directories

Path Synopsis
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.

Jump to

Keyboard shortcuts

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