func WithHeartbeat(heartbeat time.Duration) Option {
	return func(opts *Options) {
		opts.Heartbeat = heartbeat
	}
}
WithHeartbeat sets the minimum time between heartbeat messages. By default, messages are only sent if
no messages have been sent since the last heartbeat message - to change this behaviour you can disable heartbeats
(by passing in -1), and implementing your own logic.
package frisbee
import (
	"crypto/tls"
	"github.com/rs/zerolog"
	"os"
	"time"
)
type Option func(opts *Options)
var DefaultLogger = zerolog.New(os.Stdout)
type Options struct {
	KeepAlive time.Duration
	Heartbeat time.Duration
	Logger    *zerolog.Logger
	TLSConfig *tls.Config
}
func loadOptions(options ...Option) *Options {
	opts := new(Options)
	for _, option := range options {
		option(opts)
	}
	if opts.Logger == nil {
		opts.Logger = &DefaultLogger
	}
	if opts.KeepAlive == 0 {
		opts.KeepAlive = time.Minute * 3
	}
	if opts.Heartbeat == 0 {
		opts.Heartbeat = time.Second * 5
	}
	return opts
}
func WithOptions(options Options) Option {
	return func(opts *Options) {
		*opts = options
	}
}
func WithKeepAlive(keepAlive time.Duration) Option {
	return func(opts *Options) {
		opts.KeepAlive = keepAlive
	}
}
func WithLogger(logger *zerolog.Logger) Option {
	return func(opts *Options) {
		opts.Logger = logger
	}
}