func (s *Service) Subscribe(topic string, v interface{}) error {
	return s.Server().Subscribe(s.Server().NewSubscriber(topic, v))
}
Subscribe registers a subscriber
package service
import (
	"context"
	"errors"
	"fmt"
	"os"
	"os/signal"
	"runtime"
	"syscall"
	"github.com/micro/micro/v3/cmd"
	"github.com/micro/micro/v3/service/client"
	mudebug "github.com/micro/micro/v3/service/debug"
	debug "github.com/micro/micro/v3/service/debug/handler"
	"github.com/micro/micro/v3/service/logger"
	"github.com/micro/micro/v3/service/model"
	"github.com/micro/micro/v3/service/server"
	"github.com/urfave/cli/v2"
)
var (
	errMissingName = errors.New("missing service name")
)
type Service struct {
	opts Options
}
func Run() {
	srv := New()
	if err := srv.Run(); err == errMissingName {
		fmt.Println("Micro services must be run using \"micro run\"")
		os.Exit(1)
	} else if err != nil {
		logger.Fatalf("Error running %v service: %v", srv.Name(), err)
	}
}
func New(opts ...Option) *Service {
	before := func(ctx *cli.Context) error {
		if n := ctx.String("service_name"); len(n) > 0 {
			opts = append(opts, Name(n))
		}
		if v := ctx.String("service_version"); len(v) > 0 {
			opts = append(opts, Version(v))
		}
		if a := ctx.String("service_address"); len(a) > 0 {
			opts = append(opts, Address(a))
		}
		return nil
	}
	cmd.New(cmd.SetupOnly(), cmd.Before(before)).Run()
	return &Service{opts: newOptions(opts...)}
}
func (s *Service) Name() string {
	return s.opts.Name
}
func (s *Service) Version() string {
	return s.opts.Version
}
func (s *Service) Handle(v interface{}) error {
	return s.Server().Handle(s.Server().NewHandler(v))
}