Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what does stringArray mean? #19

Open
gy0624ww opened this issue Mar 12, 2021 · 4 comments
Open

what does stringArray mean? #19

gy0624ww opened this issue Mar 12, 2021 · 4 comments

Comments

@gy0624ww
Copy link

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
Copy link
Author

@GrantZheng

@GrantZheng
Copy link
Owner

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
Copy link
Author

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

@GrantZheng
Copy link
Owner

GrantZheng commented Mar 17, 2021

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants