nacelle

package module
v0.0.0-...-19169da Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 7 Imported by: 11

README

Nacelle logo

Nacelle

GoDoc Build Status Maintainability Test Coverage

Nacelle is a microservice framework written in Go.


Examples

For example usage, see the examples provided along with in this project.

Frameworks

The following frameworks are built on top of nacelle to provide rich features to a single primary process.

Documentation

License

Copyright (c) 2017 Eric Fritz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

View Source
const (
	LevelFatal   = logging.LevelFatal
	LevelError   = logging.LevelError
	LevelWarning = logging.LevelWarning
	LevelInfo    = logging.LevelInfo
	LevelDebug   = logging.LevelDebug
)

Variables

View Source
var (
	NewConfig                   = config.NewConfig
	NewLoggingConfig            = config.NewLoggingConfig
	NewEnvSourcer               = config.NewEnvSourcer
	NewFileSourcer              = config.NewFileSourcer
	NewGlobSourcer              = zubrin.NewGlobSourcer
	NewOptionalFileSourcer      = config.NewOptionalFileSourcer
	NewDirectorySourcer         = config.NewDirectorySourcer
	NewOptionalDirectorySourcer = config.NewOptionalDirectorySourcer
	NewYAMLFileSourcer          = config.NewYAMLFileSourcer
	NewTOMLFileSourcer          = config.NewTOMLFileSourcer
	NewMultiSourcer             = config.NewMultiSourcer
	NewEnvTagPrefixer           = config.NewEnvTagPrefixer
	NewFileTagPrefixer          = config.NewFileTagPrefixer
	NewDefaultTagSetter         = config.NewDefaultTagSetter
)
View Source
var (
	NewNilLogger       = logging.NewNilLogger
	NewReplayAdapter   = logging.NewReplayAdapter
	NewRollupAdapter   = logging.NewRollupAdapter
	LogEmergencyError  = logging.LogEmergencyError
	LogEmergencyErrors = logging.LogEmergencyErrors
	EmergencyLogger    = logging.EmergencyLogger
)
View Source
var (
	NewParallelInitializer     = process.NewParallelInitializer
	WithStartTimeout           = process.WithStartTimeout
	WithHealthCheckBackoff     = process.WithHealthCheckBackoff
	WithShutdownTimeout        = process.WithShutdownTimeout
	WithInitializerName        = process.WithInitializerName
	WithProcessName            = process.WithProcessName
	WithPriority               = process.WithPriority
	WithSilentExit             = process.WithSilentExit
	WithInitializerTimeout     = process.WithInitializerTimeout
	WithProcessInitTimeout     = process.WithProcessInitTimeout
	WithProcessStartTimeout    = process.WithProcessStartTimeout
	WithProcessShutdownTimeout = process.WithProcessShutdownTimeout
)
View Source
var NewServiceContainer = service.NewContainer

Functions

This section is empty.

Types

type AppInitFunc

type AppInitFunc func(ProcessContainer, ServiceContainer) error

AppInitFunc is an program entrypoint called after performing initial configuration loading, sanity checks, and setting up loggers. This function should register initializers and processes and inject values into the service container where necessary.

type Bootstrapper

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

Bootstrapper wraps the entrypoint to the program.

func NewBootstrapper

func NewBootstrapper(
	name string,
	initFunc AppInitFunc,
	bootstrapperConfigs ...BootstrapperConfigFunc,
) *Bootstrapper

NewBootstrapper creates an entrypoint to the program with the given configs.

func (*Bootstrapper) Boot

func (bs *Bootstrapper) Boot() int

Boot will initialize services and return a status code. This method does not return in any meaningful way (it blocks until the associated process runner has completed).

func (*Bootstrapper) BootAndExit

func (bs *Bootstrapper) BootAndExit()

BootAndExit calls Boot and sets the program return code on halt. This method does not return.

type BootstrapperConfigFunc

type BootstrapperConfigFunc func(*bootstrapperConfig)

BootstrapperConfigFunc is a function used to configure an instance of a Bootstrapper.

func WithConfigMaskedKeys

func WithConfigMaskedKeys(configMaskedKeys []string) BootstrapperConfigFunc

WithConfigMaskedKeys sets the keys that are redacted when printed by the config logger.

func WithConfigSourcer

func WithConfigSourcer(configSourcer ConfigSourcer) BootstrapperConfigFunc

WithConfigSourcer sets the source that should be used for populating config structs.

func WithLoggingFields

func WithLoggingFields(loggingFields LogFields) BootstrapperConfigFunc

WithLoggingFields sets additional fields sent with every log message.

func WithLoggingInitFunc

func WithLoggingInitFunc(loggingInitFunc LoggingInitFunc) BootstrapperConfigFunc

WithLoggingInitFunc sets the function that initializes logging.

func WithRunnerOptions

func WithRunnerOptions(configs ...RunnerConfigFunc) BootstrapperConfigFunc

WithRunnerOptions passes RunnerConfigFuncs to the runner created by Boot.

type Config

type Config = config.Config

type ConfigSourcer

type ConfigSourcer = config.Sourcer

type Health

type Health = process.Health

type Initializer

type Initializer = process.Initializer

type InitializerConfigFunc

type InitializerConfigFunc = process.InitializerConfigFunc

type InitializerFunc

type InitializerFunc = process.InitializerFunc

func WrapServiceInitializerFunc

func WrapServiceInitializerFunc(container ServiceContainer, f ServiceInitializerFunc) InitializerFunc

WrapServiceInitializerFunc creates an InitializerFunc from a ServiceInitializerFunc and a container.

type LogFields

type LogFields = logging.Fields

type LogLevel

type LogLevel = logging.LogLevel

type Logger

type Logger = logging.Logger

type LoggingInitFunc

type LoggingInitFunc func(Config) (Logger, error)

LoggingInitFunc creates a factory from a config object.

type ParallelInitializer

type ParallelInitializer = process.ParallelInitializer

type Process

type Process = process.Process

type ProcessConfigFunc

type ProcessConfigFunc = process.ProcessConfigFunc

type ProcessContainer

type ProcessContainer = process.Container

type RunnerConfigFunc

type RunnerConfigFunc = process.RunnerConfigFunc

type ServiceContainer

type ServiceContainer = service.Container

type ServiceInitializerFunc

type ServiceInitializerFunc func(config Config, container ServiceContainer) error

ServiceInitializerFunc is an InitializerFunc with a service container argument.

type TagModifier

type TagModifier = config.TagModifier

Directories

Path Synopsis
base
grpc/internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.
examples
grpc
Package main is a generated protocol buffer package.
Package main is a generated protocol buffer package.
multi-grpc
Package main is a generated protocol buffer package.
Package main is a generated protocol buffer package.
multi-process/grpc
Package grpc is a generated protocol buffer package.
Package grpc is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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