Package base defines shared basic pieces of the ent command.



This section is empty.


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

DefaultConfig for loading Go base.


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 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.


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.