GrantZheng / kit

GoKit CLI
MIT License
268 stars 54 forks source link

what does stringArray mean? #19

Open gy0624ww opened 3 years ago

gy0624ww commented 3 years ago

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 commented 3 years ago

@GrantZheng

GrantZheng commented 3 years ago

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?

gy0624ww commented 3 years ago

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

GrantZheng commented 3 years ago

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 !