app

package
v0.0.0-...-6e01b02 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServiceName = "microservice-go"
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *flag.FlagSet)

func AddSharedFlags

func AddSharedFlags(flags *flag.FlagSet)

Types

type App

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

func NewApp

func NewApp(params *Params) *App

func (*App) Close

func (a *App) Close() error

func (*App) Start

func (a *App) Start(appOptions *Options) error

type Logging

type Logging struct {
	LogLevel string
}

type Options

type Options struct {
	GRPCPort    int
	ServiceName string
}

func (*Options) InitFromViper

func (aOpts *Options) InitFromViper(v *viper.Viper) *Options

type Params

type Params struct {
	ServiceName string
	Logger      *zap.Logger
	HealthCheck *hc.HealthCheck
	Tracer      opentracing.Tracer
}

type Service

type Service struct {
	ServiceName string

	Logger *zap.Logger

	AdminServer *server.AdminServer
	// contains filtered or unexported fields
}

func NewService

func NewService(serviceName string, adminPort int) *Service

func (*Service) AddFlags

func (s *Service) AddFlags(flagSet *flag.FlagSet)

func (*Service) HC

func (s *Service) HC() *hc.HealthCheck

func (*Service) RunAndThen

func (s *Service) RunAndThen(shutdown func())

func (*Service) SetHCStatus

func (s *Service) SetHCStatus(status hc.Status)

func (*Service) Start

func (s *Service) Start(v *viper.Viper) error

type SharedFlags

type SharedFlags struct {
	Logging
	Tracing
}

func (*SharedFlags) InitFromViper

func (aOpts *SharedFlags) InitFromViper(v *viper.Viper) *SharedFlags

func (*SharedFlags) NewLogger

func (aOpts *SharedFlags) NewLogger(conf zap.Config, options ...zap.Option) (*zap.Logger, error)

type Tracing

type Tracing struct {
	AlwaysSample       bool
	MaxTracesPerSecond float64
	RefreshInterval    time.Duration
	SamplerType        string
	SamplingRate       float64
	StrategyURI        string

	AgentHost             string
	AgentGRPCPort         int
	AgentHttpPort         int
	BufferRefreshInterval time.Duration
	ReporterType          string
	UdpMaxPacketSize      int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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