kit icon indicating copy to clipboard operation
kit copied to clipboard

what does stringArray mean?

Open gy0624ww opened this issue 3 years ago • 4 comments

Usage: kit generate service [flags]

Aliases: service, s

Flags: -w, --dmw Generate default middleware for service and endpoint --endpoint-mdw If set a default Logging and Tracking middleware will be created and attached to the endpoint --gorilla Generate http using gorilla mux -h, --help help for service -m, --methods stringArray Specify methods to be generated -i, --pb_import_path string Specify path to import pb -p, --pb_path string Specify path to store pb dir --svc-mdw If set a default Logging and Instrumental middleware will be created and attached to the service -t, --transport string The transport you want your service to be initiated with (default "http")

Global Flags: -d, --debug If you want to see the debug logs. -b, --folder string If you want to specify the base folder of the project. -f, --force Force overide existing files without asking.

what's the correct way to specify methods with stringArray?

gy0624ww avatar Mar 12 '21 09:03 gy0624ww

@GrantZheng

gy0624ww avatar Mar 15 '21 02:03 gy0624ww

Usage: kit generate service [flags]

Aliases: service, s

Flags: -w, --dmw Generate default middleware for service and endpoint --endpoint-mdw If set a default Logging and Tracking middleware will be created and attached to the endpoint --gorilla Generate http using gorilla mux -h, --help help for service -m, --methods stringArray Specify methods to be generated -i, --pb_import_path string Specify path to import pb -p, --pb_path string Specify path to store pb dir --svc-mdw If set a default Logging and Instrumental middleware will be created and attached to the service -t, --transport string The transport you want your service to be initiated with (default "http")

Global Flags: -d, --debug If you want to see the debug logs. -b, --folder string If you want to specify the base folder of the project. -f, --force Force overide existing files without asking.

what's the correct way to specify methods with stringArray?

Hi, sorry for getting back to you late. I do not understand clearly about the "specify methods with stringArray". Could you give me a more detailed explanation about it, or show a scenario that uses it?

GrantZheng avatar Mar 15 '21 03:03 GrantZheng

could u show an example to use the param of -m?

gy0624ww avatar Mar 16 '21 10:03 gy0624ww

could u show an example to use the param of -m?

./test/pkg/service/service.go

type TestService interface {
        // Add your methods here Foo(ctx context.Context, s string) (rs string, err error)
        Boo(ctx context.Context, s string) (rs string, err error)
        Foo(ctx context.Context, s string) (rs string, err error)
        Coo(ctx context.Context, s string) (rs string, err error)
        Doo(ctx context.Context, s string) (rs string, err error)
        Eoo(ctx context.Context, s string) (rs string, err error)
        Foo(ctx context.Context, s string) (rs string, err error)
}

kit g s test -m Foo Coo --dmw

Separating the array with space !

GrantZheng avatar Mar 17 '21 11:03 GrantZheng