service

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v0.2.0

func Run(services ...Command)

Types

type Command added in v0.2.0

type Command interface {
	Command() *cli.Command
}

type Desc

type Desc struct {
	grpc.ServiceDesc
	Handler interface{}
}

type Handler

type Handler interface {
	Router(r fiber.Router)
}

type Options

type Options struct {
	Id        string            `json:"id,omitempty"`
	Name      string            `json:"name,omitempty"`
	Version   string            `json:"version,omitempty"`
	Port      int               `json:"port,omitempty"`
	Address   string            `json:"address,omitempty"`
	Advertise string            `json:"advertise"`
	Metadata  map[string]string `json:"metadata,omitempty"`
}

type Service

type Service interface {
	Start() error
	Stop() error
	Options() Options
	Command() *cli.Command
	AfterStops(...func())
	BeforeStops(...func())
	AfterStarts(...func())
	BeforeStarts(...func())
	Provide(constructors ...interface{})
	Invoke(funcs ...interface{})
	Flags(flags ...cli.Flag)
	Middleware(middleware.Middleware)
	RegService(desc Desc)
	RegApp(prefix string, r *fiber.App)
	RegRouter(prefix string, fn func(r fiber.Router))
	RegGateway(fn func(ctx context.Context, mux *runtime.ServeMux, cc grpc.ClientConnInterface) error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL