Compare commits

..

2 Commits

Author SHA1 Message Date
b8232e02be register: add ListName option
All checks were successful
test / test (push) Successful in 3m50s
coverage / build (push) Successful in 8m15s
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-12-27 19:12:57 +03:00
vtolstov
f8c5e10c1d Apply Code Coverage Badge 2024-12-26 22:21:35 +00:00
2 changed files with 11 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
# Micro
![Coverage](https://img.shields.io/badge/Coverage-45.1%25-yellow)
![Coverage](https://img.shields.io/badge/Coverage-44.6%25-yellow)
Micro is a standard library for microservices.

View File

@@ -130,9 +130,12 @@ func NewLookupOptions(opts ...LookupOption) LookupOptions {
// ListOptions holds the list options for list method
type ListOptions struct {
// Context used to store additional options
Context context.Context
// Namespace to scope the request to
Namespace string
// Name filter services by name
Name string
}
// NewListOptions returns list options filled by opts
@@ -294,6 +297,13 @@ func ListNamespace(d string) ListOption {
}
}
// ListName sets the name for list method to filter needed services
func ListName(n string) ListOption {
return func(o *ListOptions) {
o.Name = n
}
}
// Name sets the name
func Name(n string) Option {
return func(o *Options) {