feat: update

This commit is contained in:
Rogee
2024-11-29 17:46:58 +08:00
parent fbb511a9cd
commit f7de6e5a79
3 changed files with 14 additions and 6 deletions

View File

@@ -78,6 +78,10 @@ func Command(opt ...Option) Option {
} }
} }
func Arguments(f func(cmd *cobra.Command)) Option {
return f
}
func Version(ver string) Option { func Version(ver string) Option {
return func(cmd *cobra.Command) { return func(cmd *cobra.Command) {
cmd.Version = ver cmd.Version = ver

View File

@@ -52,7 +52,14 @@ type ProviderContainer struct {
type Providers []ProviderContainer type Providers []ProviderContainer
func (p Providers) With(pcs ...Providers) Providers { func (p Providers) With(pcs ...func(...opt.Option) error) Providers {
for _, pc := range pcs {
p = append(p, ProviderContainer{Provider: pc})
}
return p
}
func (p Providers) WithProviders(pcs ...Providers) Providers {
for _, pc := range pcs { for _, pc := range pcs {
p = append(p, pc...) p = append(p, pc...)
} }

View File

@@ -1,8 +1,5 @@
package contracts package contracts
type HttpRoute interface{} type HttpRoute interface {
Register() error
type HttpService interface {
Serve() error
GetEngine() interface{}
} }