Add runtime to service.Options()
This commit is contained in:
@@ -3,6 +3,8 @@ package runtime
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"github.com/micro/go-micro/v2/client"
|
||||
)
|
||||
|
||||
type Option func(o *Options)
|
||||
@@ -17,6 +19,8 @@ type Options struct {
|
||||
Source string
|
||||
// Base image to use
|
||||
Image string
|
||||
// Client to use when making requests
|
||||
Client client.Client
|
||||
}
|
||||
|
||||
// WithSource sets the base image / repository
|
||||
@@ -47,6 +51,13 @@ func WithImage(t string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithClient sets the client to use
|
||||
func WithClient(c client.Client) Option {
|
||||
return func(o *Options) {
|
||||
o.Client = c
|
||||
}
|
||||
}
|
||||
|
||||
type CreateOption func(o *CreateOptions)
|
||||
|
||||
type ReadOption func(o *ReadOptions)
|
||||
|
Reference in New Issue
Block a user