exportenums

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

package exportenums generates the enums for the export types based on the entx annotation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OutputDir   string
	PackageName string
}

Config is the configuration for the export enums extension.

type Extension

type Extension struct {
	entc.DefaultExtension
	// contains filtered or unexported fields
}

Extension implements entc.Extension

func New

func New(opts ...ExtensionOption) *Extension

New creates a new export enums extension

func (Extension) Hook

func (e Extension) Hook() gen.Hook

func (Extension) Hooks

func (e Extension) Hooks() []gen.Hook

Hooks satisfies the entc.Extension interface

type ExtensionOption

type ExtensionOption = func(*Extension)

ExtensionOption is a function that modifies the Extension configuration.

func WithGeneratedDir

func WithGeneratedDir(outputDir string) ExtensionOption

WithGeneratedDir allows you to set an alternative output directory Defaults to "./pkg/enums"

func WithPackageName

func WithPackageName(packageName string) ExtensionOption

WithPackageName allows you to set an alternative package name for the generated file Defaults to "enums"

Jump to

Keyboard shortcuts

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