impl

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Code generated by options-gen. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(opts Options) error

Types

type Field

type Field struct {
	Name string
	Tags map[string]structtag.Tag
}

type FieldFromTag

type FieldFromTag struct {
	Name  string // name of field from Go structure. ex: UserID
	Value string // name of field from tag. ex: user_id
}

type OptOptionsSetter

type OptOptionsSetter func(o *Options)

func WithIgnoreStructs

func WithIgnoreStructs(opt []string) OptOptionsSetter

func WithIncludeStructs

func WithIncludeStructs(opt []string) OptOptionsSetter

func WithIncludedFiles added in v0.4.0

func WithIncludedFiles(opt []string) OptOptionsSetter

func WithOutFilename

func WithOutFilename(opt string) OptOptionsSetter

func WithOutPackage

func WithOutPackage(opt string) OptOptionsSetter

func WithSource

func WithSource(opt string) OptOptionsSetter

func WithTags

func WithTags(opt []string) OptOptionsSetter

type Options

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

func NewOptions

func NewOptions(
	options ...OptOptionsSetter,
) Options

func (*Options) Validate

func (o *Options) Validate() error

type Struct

type Struct struct {
	Name   string
	Fields []Field
}

type StructData

type StructData struct {
	Name string
	Tags []StructTag
}

type StructTag

type StructTag struct {
	Name   string // name of tag with public access. ex: Json, Sql, Pg
	Fields []FieldFromTag
}

type TemplateData

type TemplateData struct {
	PackageName string
	Structs     []StructData
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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