This changes some of the internals of how functional options
are used so that it gives more flexibility when growing the number
of options in the client.
The API stays the same but instead of options being concrete types,
PubOpt, SubOpt and JSOpt are interfaces so that the behavior changes
depending on where an option is used.
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
This separates the JetStream interface into two smaller interfaces:
A JetStream interface which is for producing and consuming messages
and a JetStreamManager interface for creating streams/consumers.
This also adds a new interface that is the compound of both called
JetStreamContext and is the one that is being returned when calling
`nc.JetStream()`.
This change allows to opt-in to the behaviors provided by the
JetStreamContext as needed, for example:
```go
// Can be used to produce/consume messages, but not for creating streams
var js nats.JetStream
js, err = nc.JetStream()
// Can be used for managing streams/consumers
var jsm nats.JetStreamManager
js, err = nc.JetStream()
// Can still be used to both create streams and publish
js, err := nc.JetStream()
```
Signed-off-by: Waldemar Quevedo <wally@synadia.com>