base

package
v0.14.8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package base defines shared basic pieces of the ent command.

Index

Constants

This section is empty.

Variables

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

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.

Jump to

Keyboard shortcuts

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