commands

Basic Commands

Use cwgo doc -h to view usage details:

NAME:
   cwgo doc - generate doc model

              Examples:
                # Generate doc model code
                cwgo doc --name mongodb --idl {{path/to/IDL_file.thrift}}


USAGE:
   cwgo doc [command options] [arguments...]

OPTIONS:
   --idl value [ --idl value ]                                                  Specify the IDL file path. (.thrift or .proto)
   --module value, --mod value                                                  Specify the Go module name to generate go.mod.
   --out_dir value                                                              Specify output directory, default is current dir.
   --model_dir value                                                            Specify model output directory, default is biz/doc/model.
   --dao_dir value                                                              Specify dao output directory, default is biz/doc/dao.
   --name value                                                                 Specify specific doc name, default is mongodb.
   --proto_search_path value, -I value [ --proto_search_path value, -I value ]  Add an IDL search path for includes.
   --thriftgo value, -t value [ --thriftgo value, -t value ]                    Specify arguments for the thriftgo. ({flag}={value})
   --protoc value, -p value [ --protoc value, -p value ]                        Specify arguments for the protoc. ({flag}={value})
   --verbose                                                                    Turn on verbose mode, default is false. (default: false)
   --help, -h                                                                   show help (default: false)

Specification

  • idl Specify the main IDL path required for code generation

  • module/-mod Specify the go mod name, which must be specified outside of GOPATH. In GOPATH, the default name is the path relative to GOPATH

  • out_dir Specify the code output directory, which defaults to the command execution directory

  • model_dir Specify the model code directory generated by thriftgo or protoc, which defaults to biz/doc/model

  • dao_dir Specify the directory for the generated doc curd code, which defaults to biz/doc/dao

  • name Specify the document type database name for generating code, default to mongodb, currently only mongodb is supported

  • proto_search_path/-I Specify the IDL search directory to use when IDL type is proto

  • thriftgo/-t Parameters passed through to thriftgo

  • protoc/-p Parameters passed through to protoc

  • verbose Default to false, specified as true will output more detailed log content

  • help/-h help command


Last modified June 26, 2024 : doc: add construct use case (#1098) (83b7cf9)