Add runtime to service.Options()

This commit is contained in:
Ben Toogood
2020-05-11 17:09:28 +01:00
parent 688228377b
commit f892b41299
6 changed files with 42 additions and 20 deletions

View File

@@ -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)