env

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: MIT Imports: 1 Imported by: 13

Documentation

Index

Constants

View Source
const ID = "env"

ID contains default svc name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// values to set as worker _ENV.
	Values map[string]string
}

Config defines set of env values for RR workers.

func (*Config) Hydrate

func (c *Config) Hydrate(cfg service.Config) error

Hydrate must populate Config values using given Config source. Must return error if Config is not valid.

type Provider

type Provider interface {
	// GetEnv must return list of env variables.
	GetEnv() (map[string]string, error)
}

Provider aggregates list of environment variables. This interface can be used in custom implementation to drive values from external sources.

type Service

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

Service provides ability to map _ENV values from config file.

func NewService

func NewService(version string) *Service

NewService creates new env service instance for given rr version.

func (*Service) GetEnv

func (s *Service) GetEnv() (map[string]string, error)

GetEnv must return list of env variables.

func (*Service) Init

func (s *Service) Init(cfg *Config) (bool, error)

Init must return configure svc and return true if svc hasStatus enabled. Must return error in case of misconfiguration. Services must not be used without proper configuration pushed first.

Jump to

Keyboard shortcuts

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