quick

package module
v0.0.0-...-e25a897 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

quick

Quick is the Quickstart entry for github.com/go-orb/go-orb it mimics the behaviour of go-micro.dev/v4.

WIP

This project is a work in progress, please do not use yet!

Authors

License

go-micro is Apache 2.0 licensed.

Documentation

Overview

Package quick is the quick start entry for the orb framework.

Index

Constants

This section is empty.

Variables

View Source
var ErrRequiredOption = errors.New("required option not given")

ErrRequiredOption is returned when an required option haven't been given.

Functions

This section is empty.

Types

type HookFunc

type HookFunc func(service *Service) error

type Option

type Option func(*Options)

type Options

type Options struct {
	ServiceName string
	Version     string

	Address          string
	Name             string
	Description      string
	Usage            string
	ConfigURLs       []string
	RegisterTTL      int
	RegisterInterval int
	Metadata         map[string]string

	// Before and After funcs
	Actions     []HookFunc
	BeforeStart []HookFunc
	BeforeStop  []HookFunc
	AfterStart  []HookFunc
	AfterStop   []HookFunc
}

Options for orb service.

func NewOptions

func NewOptions(opts ...Option) *Options

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is an interface that wraps the lower level components within orb. Its a convenience method for building and initializing services.

func NewService

func NewService(opts ...Option) (*Service, error)

func ProvideService

func ProvideService(
	opts *Option,
	logger log.Logger,
	registry registry.Registry,
) (*Service, error)

ProvideService provides a service with components.

func (*Service) Logger

func (s *Service) Logger() log.Logger

Logger returns the services logger.

func (*Service) Name

func (s *Service) Name() string

Name returns the name of the service.

func (*Service) Registry

func (s *Service) Registry() registry.Registry

Registry returns the services registry, it may returns nil.

func (*Service) Version

func (s *Service) Version() string

Version returns the version of the service.

Jump to

Keyboard shortcuts

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