bootstrap

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(configPath string) *context.ApplicationContext

func StartGozeApplication

func StartGozeApplication(components ...interface{})

Types

type Configuration

type Configuration struct {
	Server       RestConfiguration
	Cache        RedisConfiguration
	MicroService MicroServiceConfiguration
	LoadBalance  LoadBalanceConfiguration
	SQL          SQLConfiguration
}

type LoadBalanceConfiguration

type LoadBalanceConfiguration struct {
	LoadBalanceRule balancer.LoadBalanceRule

	//Timeout for WRR Balancer http client
	WRRBalancerTimeout time.Duration
}

type MicroServiceConfiguration

type MicroServiceConfiguration struct {
	EnableDiscoverServer bool
	EnableDiscoverClient bool
	DiscoverServerAddr   string
	ServiceName          string
	//Weighted round robin only
	Weight uint
}

type RedisConfiguration

type RedisConfiguration struct {
	Address        string
	Network        string
	Password       string
	WriteTimeout   time.Duration
	ReadTimeout    time.Duration
	ConnectTimeout time.Duration
	Db             int
}

type RestConfiguration

type RestConfiguration struct {
	ServerAddr        string
	ReadTimeout       time.Duration
	ReadHeaderTimeout time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
	MaxHeaderBytes    int
}

type SQLConfiguration

type SQLConfiguration struct {
	DataSource string
	DriverName string
}

Jump to

Keyboard shortcuts

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