beauty

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

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

beauty

beauty a micro service

How to start a micro service

brew install bufbuild/buf/buf

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(f func())

Types

type App

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

App ..

func New

func New(opts ...Option) *App

New ..

func (*App) Hook

func (app *App) Hook(stage HookEvent, fn HookFunc)

Hook add a hook func to stage

func (*App) Start

func (s *App) Start(ctx context.Context) error

Start ..

type HookEvent

type HookEvent int
const (
	//EventBeforeRun ..
	EventBeforeRun HookEvent = iota
	//EventAfterRun ..
	EventAfterRun
)

type HookFunc

type HookFunc func(app *App)

HookFunc ..

type Option

type Option func(app *App)

Option ..

func WithComponent

func WithComponent(c core.Component) Option

func WithCrontab

func WithCrontab(opts ...cron.CronOptions) Option

func WithGrpcServer

func WithGrpcServer(addr string, handler func(*grpc.Server), opts ...ServiceOption) Option

func WithMetric

func WithMetric(opts ...tracing.MetricOption) Option

func WithRegistry

func WithRegistry(r discover.Registry) Option

func WithService

func WithService(s Service, opts ...ServiceOption) Option

WithService ..

func WithTrace

func WithTrace(opts ...tracing.TraceOption) Option

func WithWebServer

func WithWebServer(addr string, mux http.Handler, opts ...ServiceOption) Option

type Service

type Service interface {
	Start(ctx context.Context) error
	String() string
}

Service ..

type ServiceKind

type ServiceKind interface {
	Kind() string
}

type ServiceOption

type ServiceOption func(*discover.ServiceInfo)

type ServiceOption func(*ServiceContext)

func WithServiceMeta

func WithServiceMeta(k, v string) ServiceOption

func WithServiceName

func WithServiceName(name string) ServiceOption

Directories

Path Synopsis
example/api/v1
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.
svc
pkg
tools module

Jump to

Keyboard shortcuts

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