gogenerate

package
v0.33.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 3 Imported by: 0

README

CLI example

Code you write is - client.go and options.go. To generate options_generated.go you can just go generate like that:

go install github.com/kazhuravlev/options-gen/cmd/options-gen@latest

git clone git@github.com:kazhuravlev/options-gen.git
cd options-gen/examples/go-generate-2options-1pkg

go generate ./...

Documentation

Overview

Code generated by options-gen. DO NOT EDIT.

Code generated by options-gen. DO NOT EDIT.

Index

Constants

View Source
const (
	FieldKKKfield0 optKKKField = 0
	FieldKKKfield1 optKKKField = 1
	FieldKKKfield2 optKKKField = 2
	FieldKKKfield3 optKKKField = 3
)
View Source
const (
	FieldNNNfield1 optNNNField = 0
	FieldNNNfield2 optNNNField = 1
	FieldNNNfield3 optNNNField = 2
	FieldNNNfield4 optNNNField = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(opts1 Options1, opts2 Options2) (*Client, error)

type OptOptions1Setter

type OptOptions1Setter func(o *Options1)

func WithKKKField0

func WithKKKField0(opt int) OptOptions1Setter

Options1.field0

func WithKKKField1

func WithKKKField1(opt int) OptOptions1Setter

Options1.field1

func WithKKKField2

func WithKKKField2(opt int) OptOptions1Setter

Options1.field2

func WithKKKField3

func WithKKKField3(opt int) OptOptions1Setter

Options1.field3

type OptOptions2Setter

type OptOptions2Setter func(o *Options2)

func WithNNNField1

func WithNNNField1(opt int) OptOptions2Setter

Options2.field1

func WithNNNField2

func WithNNNField2(opt int) OptOptions2Setter

Options2.field2

func WithNNNField3

func WithNNNField3(opt int) OptOptions2Setter

Options2.field3

func WithNNNField4

func WithNNNField4(opt int) OptOptions2Setter

Options2.field4

type Options1

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

func NewOptions1

func NewOptions1(
	options ...OptOptions1Setter,
) Options1

func (*Options1) IsSet added in v0.33.0

func (o *Options1) IsSet(field optKKKField) bool

func (*Options1) Validate

func (o *Options1) Validate() error

type Options2

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

func NewOptions2

func NewOptions2(
	options ...OptOptions2Setter,
) Options2

func (*Options2) IsSet added in v0.33.0

func (o *Options2) IsSet(field optNNNField) bool

func (*Options2) Validate

func (o *Options2) Validate() error

Jump to

Keyboard shortcuts

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