skeleton

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

skeleton package contains a framework to develop micro service.

Index

Constants

View Source
const (
	DefaultLogLevel = "info"
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *flag.FlagSet)

Types

type Logging

type Logging struct {
	LogLevel string
}

type Service

type Service struct {
	ServiceName string

	Logger *zap.Logger

	AdminServer *server.AdminServer

	MetricsFactory metrics.Factory
	// 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
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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