Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a3e8ab2492 | ||
06da500ef4 | |||
277f04ba19 | |||
|
470263ff5f | ||
b8232e02be | |||
|
f8c5e10c1d |
@ -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.
|
||||
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"crypto/tls"
|
||||
"time"
|
||||
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/meter"
|
||||
"go.unistack.org/micro/v3/tracer"
|
||||
@ -26,6 +27,8 @@ type Options struct {
|
||||
Name string
|
||||
// Addrs specifies register addrs
|
||||
Addrs []string
|
||||
// Codec used to marshal/unmarshal data in register
|
||||
Codec codec.Codec
|
||||
// Timeout specifies timeout
|
||||
Timeout time.Duration
|
||||
}
|
||||
@ -37,6 +40,7 @@ func NewOptions(opts ...Option) Options {
|
||||
Meter: meter.DefaultMeter,
|
||||
Tracer: tracer.DefaultTracer,
|
||||
Context: context.Background(),
|
||||
Codec: codec.NewCodec(),
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
@ -130,6 +134,7 @@ 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
|
||||
@ -300,3 +305,9 @@ func Name(n string) Option {
|
||||
o.Name = n
|
||||
}
|
||||
}
|
||||
|
||||
func Codec(c codec.Codec) Option {
|
||||
return func(o *Options) {
|
||||
o.Codec = c
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user