package base

import "entgo.io/ent/cmd/internal/base"

Package base defines shared basic pieces of the ent command.

Index

Variables

var DefaultConfig = &packages.Config{Mode: packages.NeedName}

DefaultConfig for loading Go base.

Functions

func DescribeCmd

func DescribeCmd() *cobra.Command

DescribeCmd returns the describe command for ent/c packages.

func GenerateCmd

func GenerateCmd(postRun ...func(*gen.Config)) *cobra.Command

GenerateCmd returns the generate command for ent/c packages.

func InitCmd

func InitCmd() *cobra.Command

InitCmd returns the init command for ent/c packages.

func NewCmd

func NewCmd() *cobra.Command

NewCmd returns the new command for ent/c packages.

func PkgPath

func PkgPath(config *packages.Config, target string) (string, error)

PkgPath returns the Go package name for given target path. Even if the existing path is not exist yet in the filesystem.

If base.Config is nil, DefaultConfig will be used to load base.

func SchemaCmd

func SchemaCmd() *cobra.Command

SchemaCmd returns DDL to use Ent as an Atlas schema loader.

Types

type IDType

type IDType field.Type

IDType is a custom ID implementation for pflag.

func (*IDType) Set

func (t *IDType) Set(s string) error

Set implements the Set method of the flag.Value interface.

func (IDType) String

func (IDType) String() string

String returns the default value for the help command.

func (IDType) Type

func (IDType) Type() string

Type returns the type representation of the id option for help command.

Source Files

base.go packages.go

Version
v0.14.4 (latest)
Published
Mar 17, 2025
Platform
linux/amd64
Imports
17 packages
Last checked
1 day ago

Tools for package owners.