app

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package app contains base application constants, flags and options.

Index

Constants

This section is empty.

Variables

View Source
var (
	InstanceUUID = uuid.New()
	StartTime    = time.Now()
	ServiceName  = "-"
	AppName      = "-"
	GitHash      = "-"
	Version      = "-"
	BuildAt      = "0001-01-01T00:00:00"
)

Functions

This section is empty.

Types

type Info added in v0.2.0

type Info struct {
	InstanceUUID string
	ServiceName  string
	AppName      string
	GitHash      string
	Version      string
	BuildAt      string
	StartTime    time.Time
}

Info contains service information.

type Option

type Option func(opts *Options) error

Option sets tron options such as ports, config, etc.

type Options

type Options struct {
	// New options.
	Hostname      string
	PortAdmin     uint16
	PortHTTP      uint16
	PortGRPC      uint16
	LoggerOptions []zap.Option
	LoggerConfig  zap.Config
	TracerConfig  *tracing.Configuration
	ExitSignals   []os.Signal
	GRPCListener  net.Listener
	HTTPListener  net.Listener

	// Run options.
	TLSConfig   *tls.Config
	GRPCOptions []grpc.ServerOption
	// contains filtered or unexported fields
}

Options is base tron options.

func NewOptions

func NewOptions(info *Info, options ...Option) (*Options, error)

NewOptions returns Options with applied Option list.

func (*Options) AddRunOptions added in v0.2.0

func (o *Options) AddRunOptions(options ...RunOption)

AddRunOptions append run options to others options.

func (*Options) ApplyRunOptions

func (o *Options) ApplyRunOptions() error

ApplyRunOptions sets run options.

type RunOption

type RunOption func(opts *Options) error

RunOption sets tron run options such as grpc unary interceptors, tls config.

Jump to

Keyboard shortcuts

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