config

package
v0.0.0-...-98801bd Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2016 License: GPL-3.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationReader

type ConfigurationReader interface {
	// GetListeningPort returns the port the application should start listening on.
	GetListeningPort() (int, error)

	// GetCassandraHosts returns the list of Cassandra host addresses.
	GetCassandraHosts() ([]string, error)

	// GetCassandraKeyspace returns the name of Cassandra key space that the service data is stored under.
	GetCassandraKeyspace() (string, error)

	// GetCassandraProtocolVersion returns the cassandra procotol version.
	GetCassandraProtocolVersion() (int, error)
}

ConfigurationReader defines the interface that provides access to all configurations parameters required by the service.

type ConsulConfigurationReader

type ConsulConfigurationReader struct {
	ConsulAddress                      string
	ConsulScheme                       string
	ListeningPortToOverride            int
	CassandraHostsToOverride           []string
	CassandraKeyspaceToOverride        string
	CassandraProtocolVersionToOverride int
}

ConsulConfigurationReader implements ConfigurationReader using Consul to provide access to all configurations parameters required by the service.

func (ConsulConfigurationReader) GetCassandraHosts

func (consul ConsulConfigurationReader) GetCassandraHosts() ([]string, error)

GetCassandraHosts returns the list of Cassandra host addresses.

func (ConsulConfigurationReader) GetCassandraKeyspace

func (consul ConsulConfigurationReader) GetCassandraKeyspace() (string, error)

GetCassandraKeyspace returns the name of Cassandra key space that the service data is stored under.

func (ConsulConfigurationReader) GetCassandraProtocolVersion

func (consul ConsulConfigurationReader) GetCassandraProtocolVersion() (int, error)

GetCassandraProtocolVersion returns the Cassandra protocol version to be used when connecting to Cassandra database.

func (ConsulConfigurationReader) GetListeningPort

func (consul ConsulConfigurationReader) GetListeningPort() (int, error)

GetListeningPort returns the port the service should listen on to serve the HTTP request

Jump to

Keyboard shortcuts

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