echo_go_dto

package module
v0.0.0-...-65b0ea7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

README

go build codecov Test Coverage Maintainability License time tracker

DTO generator for Echo-go package based solutions

Dependencies

Generated code is based at github.com/echo-go/dto-lib

Make sure to have it as a dependency in you project after applying generator:

go get github.com/echo-go/dto-lib

or just

go mod tidy

CLI all options

To show all options as below: ./bin/echo-go-dto help

./bin/echo-go-dto  help
NAME:
   echo-go-dto generate - Echo-go DTO generator

USAGE:
   //go:generate echo-go-dto --path . generate
   //go:generate echo-go-dto -p . generate
   //go:generate echo-go-dto --path ./dto generate
   //go:generate echo-go-dto --path ./some-dto-dir generate

VERSION:
   0.2.1

AUTHOR:
   Alex <alex@webz.asia>

COMMANDS:
   generate, g  Do generate _gen.go files for all matches of injection method found
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --verbose                    verbosity flag, gives more output to the log (default: false)
   --path value, -p value       dto package path (default: "./dto")
   --pkg value                  dto package name (default: "dto")
   --injection value, -i value  dto flagging/injection method name (default: "AddAutoGeneratedResponseMethods")
   --help, -h                   show help (default: false)
   --version, -v                print the version (default: false)

COPYRIGHT:
   (c) 2020-2021 Alex <alex@webz.asia>, Apache License Version 2.0
CLI global flags

To show all global flags as below: ./bin/echo-go-dto -h or ./bin/echo-go-dto --help

Usage of ./bin/echo-go-dto:
  -method string
        dto flagging/injection method name (default "AddAutoGeneratedResponseMethods")
  -path string
        dto package path (default "./dto")
  -pkg string
        dto package name (default "dto")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAutoGeneratedResponseMethods

func AddAutoGeneratedResponseMethods(_ string, _ *[]string, _ int) error

AddAutoGeneratedResponseMethods sets the flag for further generation of response functions automatically, dummy method

func ErrorMethodNames

func ErrorMethodNames() []string

ErrorMethodNames returns list of responseErrorMethods

func FilterErrorMethods

func FilterErrorMethods(methods []string) []string

FilterErrorMethods returns only elements of responseErrorMethods

func FilterRegularMethods

func FilterRegularMethods(methods []string) []string

FilterRegularMethods returns only elements of responseMethods

func GenerateDtoFilesInPath

func GenerateDtoFilesInPath(pkgPath, pkgName, injectionMethod string, isVerbose bool) error

GenerateDtoFilesInPath generates dto extra methods

func IntersectArrays

func IntersectArrays(input, filter []string) []string

IntersectArrays returns only intersected elements of two arrays provided

func New

func New() *cli.App

func RegularMethodNames

func RegularMethodNames() []string

RegularMethodNames returns list of responseMethods

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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