func AfterStop(fn func() error) Option {
	return func(o *Options) {
		o.AfterStop = append(o.AfterStop, fn)
	}
}
AfterStop run funcs after service stops
package service
import (
	"time"
	"github.com/micro/micro/v3/cmd"
	"github.com/micro/micro/v3/service/client"
	"github.com/micro/micro/v3/service/server"
)
type Options struct {
	Cmd cmd.Cmd
	Name    string
	Version string
	BeforeStart []func() error
	BeforeStop  []func() error
	AfterStart  []func() error
	AfterStop   []func() error
	Signal bool
}
func newOptions(opts ...Option) Options {
	opt := Options{
		Cmd:    cmd.DefaultCmd,
		Signal: true,
	}
	for _, o := range opts {
		o(&opt)
	}
	return opt
}
type Option func(o *Options)
func HandleSignal(b bool) Option {
	return func(o *Options) {
		o.Signal = b
	}
}
func Address(addr string) Option {
	return func(o *Options) {
		server.DefaultServer.Init(server.Address(addr))
	}
}
func Name(n string) Option {
	return func(o *Options) {
		o.Name = n
		server.DefaultServer.Init(server.Name(n))
	}
}
func Version(v string) Option {
	return func(o *Options) {
		o.Version = v
		server.DefaultServer.Init(server.Version(v))
	}
}
func Metadata(md map[string]string) Option {
	return func(o *Options) {
		server.DefaultServer.Init(server.Metadata(md))
	}
}
func RegisterTTL(t time.Duration) Option {
	return func(o *Options) {
		server.DefaultServer.Init(server.RegisterTTL(t))
	}
}
func RegisterInterval(t time.Duration) Option {
	return func(o *Options) {
		server.DefaultServer.Init(server.RegisterInterval(t))
	}
}
func WrapClient(w ...client.Wrapper) Option {
	return func(o *Options) {
		for i := len(w); i > 0; i-- {
			client.DefaultClient = w[i-1](client.DefaultClient)
		}
	}
}
func WrapCall(w ...client.CallWrapper) Option {
	return func(o *Options) {
		client.DefaultClient.Init(client.WrapCall(w...))
	}
}
func WrapHandler(w ...server.HandlerWrapper) Option {
	return func(o *Options) {
		var wrappers []server.Option
		for _, wrap := range w {
			wrappers = append(wrappers, server.WrapHandler(wrap))
		}
		server.DefaultServer.Init(wrappers...)
	}
}
func WrapSubscriber(w ...server.SubscriberWrapper) Option {
	return func(o *Options) {
		var wrappers []server.Option
		for _, wrap := range w {
			wrappers = append(wrappers, server.WrapSubscriber(wrap))
		}
		server.DefaultServer.Init(wrappers...)
	}
}
func BeforeStart(fn func() error) Option {
	return func(o *Options) {
		o.BeforeStart = append(o.BeforeStart, fn)
	}
}
func BeforeStop(fn func() error) Option {
	return func(o *Options) {
		o.BeforeStop = append(o.BeforeStop, fn)
	}
}
func AfterStart(fn func() error) Option {
	return func(o *Options) {
		o.AfterStart = append(o.AfterStart, fn)
	}
}