configuration

package
v0.0.0-...-1e04dac Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2018 License: GPL-3.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// JSONFormat is for the logging format.
	JSONFormat = "json"
)

Variables

View Source
var (
	// ConfigType holds the supported type.
	ConfigType = "yaml"
)

Functions

This section is empty.

Types

type BikeConfiguration

type BikeConfiguration struct {
	Server     Server
	Logging    Logging
	Monitoring Monitoring

	Database  Database
	Messaging struct {
		Consumption Consumption
	}
}

BikeConfiguration specifies general configurations for the bike service.

func GetBikeConfiguration

func GetBikeConfiguration(path, databaseURL, consumerSOCKET string) (*BikeConfiguration, error)

GetBikeConfiguration returns valid configuration to run a bike service.

type Consumption

type Consumption struct {
	Address string

	Topic string
}

Consumption for messaging.

type Database

type Database struct {
	Host     string
	Port     string
	User     string
	Password string
	Name     string
}

Database configuration.

type Emission

type Emission struct {
	Address     string
	MaxInFlight int
	Topic       string
}

Emission for messaging.

type GatewayConfiguration

type GatewayConfiguration struct {
	Server     Server
	Logging    Logging
	Monitoring Monitoring
	Limiter    Limiter

	Messaging struct {
		Emission Emission
	}

	// BikeURL is the base url to bike service.
	BikeURL string

	// TripURL is the base url to trip service.
	TripURL string
}

GatewayConfiguration specifies general configurations for the gateway service.

func GetGatewayConfiguration

func GetGatewayConfiguration(path, bikeURL, tripURL string, nsq string) (*GatewayConfiguration, error)

GetGatewayConfiguration returns valid configuration to run the API gateway.

type Limiter

type Limiter struct {
	Limit float64
	Burst int
}

Limiter for rate limit features.

type Logging

type Logging struct {
	// Standard log level
	// Example:
	// 			panic,
	//			fatal,
	//			error,
	//			warn, warning,
	//			info,
	//			debug
	Level string

	// logging format
	// only json or plain text are supported
	Format string
}

Logging holds log configuration.

type Monitoring

type Monitoring struct {
	Addr   string
	Prefix string
}

Monitoring holds monitoring configuration. (for things, like statsd or else).

type Server

type Server struct {
	Port        int
	Certificate string
	PrivateKey  string
	Host        string
}

Server specifies http based configuration for the underlying server.

func (Server) String

func (s Server) String() string

String for Stringer interface.

type TripConfiguration

type TripConfiguration struct {
	Server     Server
	Logging    Logging
	Monitoring Monitoring

	Database  Database
	Messaging struct {
		Consumption Consumption
	}
}

TripConfiguration specifies general configurations for the trip service.

func GetTripConfiguration

func GetTripConfiguration(path, databaseURL, consumerSOCKET string) (*TripConfiguration, error)

GetTripConfiguration returns valid configuration to run a trip service.

Jump to

Keyboard shortcuts

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