exportenums

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 "./common/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