コード例 #1
0
func getHelloOptions() (options.Options, error) {
	return options.New("memo", map[string]interface{}{
		"service-name":        utils.GetFromEnvOr("HELLO_SERVICE_NAME", "Hello World Test"),
		"service-description": utils.GetFromEnvOr("HELLO_SERVICE_DESCRIPTION", "Basic Golang.Hr Platform hello world example service written for easier understanding of how to run and work with platform"),
		"service-version":     getFloat(utils.GetFromEnvOr("HELLO_SERVICE_VERSION", "0.1")),
		"formatter":           "text",
		"level":               logrus.DebugLevel,
		"manager-interrupt-wait-timeout": getInt(utils.GetFromEnvOr("HELLO_SERVICE_MANAGER_INTERRUPT_TIMEOUT", "1")),
		"grpc-listen-forever":            getBool(utils.GetFromEnvOr("HELLO_SERVICE_GRPC_LISTEN_FOREVER", "true")),
		"grpc-addr":                      utils.GetFromEnvOr("HELLO_SERVICE_GRPC_ADDR", ":4771"),
		"grpc-tls":                       getBool(utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS", "true")),
		"grpc-tls-domain":                utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_DOMAIN", "golang.hr"),
		"grpc-tls-cert":                  utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_CERT", "test_data/server.crt"),
		"grpc-tls-key":                   utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_KEY", "test_data/server.key"),
		"http-addr":                      utils.GetFromEnvOr("HELLO_SERVICE_HTTP_ADDR", ":8072"),
		"http-listen-forever":            getBool(utils.GetFromEnvOr("HELLO_SERVICE_HTTP_LISTEN_FOREVER", "true")),
	})
}
コード例 #2
0
ファイル: service_test.go プロジェクト: golanghr/slack-invite
func getSlackOptions() (options.Options, error) {
	return options.New("memo", map[string]interface{}{
		"service-name":        utils.GetFromEnvOr("SLACK_SERVICE_NAME", "Slack Invite"),
		"service-description": utils.GetFromEnvOr("SLACK_SERVICE_DESCRIPTION", "Golang.hr Slack Invite is a small automation service written on top of Golang.hr Platform."),
		"service-version":     getFloat(utils.GetFromEnvOr("SLACK_SERVICE_VERSION", "0.1")),
		"formatter":           "text",
		"level":               logrus.DebugLevel,
		"manager-interrupt-wait-timeout": getInt(utils.GetFromEnvOr("SLACK_SERVICE_MANAGER_INTERRUPT_TIMEOUT", "10")),
		"grpc-listen-forever":            getBool(utils.GetFromEnvOr("SLACK_SERVICE_GRPC_LISTEN_FOREVER", "true")),
		"grpc-addr":                      utils.GetFromEnvOr("SLACK_SERVICE_GRPC_ADDR", ":4772"),
		"grpc-tls":                       getBool(utils.GetFromEnvOr("SLACK_SERVICE_GRPC_TLS", "true")),
		"grpc-tls-cert":                  utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_CERT", "test_data/server.crt"),
		"grpc-tls-key":                   utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_KEY", "test_data/server.key"),
		"grpc-tls-domain":                utils.GetFromEnvOr("SLACK_SERVICE_GRPC_TLS_DOMAIN", "golang.hr"),
		"http-addr":                      utils.GetFromEnvOr("SLACK_SERVICE_HTTP_ADDR", ":8500"),
		"http-listen-forever":            getBool(utils.GetFromEnvOr("SLACK_SERVICE_HTTP_LISTEN_FOREVER", "true")),
		"slack-team-name":                utils.GetFromEnvOr("SLACK_TEAM_NAME", "golanghr"),
		"slack-token":                    utils.GetFromEnvOr("SLACK_TOKEN", ""),
		"slack-api-debug":                getBool(utils.GetFromEnvOr("SLACK_API_DEBUG", "false")),
	})
}
コード例 #3
0
ファイル: options.go プロジェクト: golanghr/slack-invite
SOFTWARE.
*/

// Package main ...
package main

import (
	"strconv"

	"github.com/Sirupsen/logrus"
	"github.com/golanghr/platform/utils"
)

var (
	serviceOptions = map[string]interface{}{
		"service-name":        utils.GetFromEnvOr("HELLO_SERVICE_NAME", "Slack Invite"),
		"service-description": utils.GetFromEnvOr("HELLO_SERVICE_DESCRIPTION", "Golang.hr Slack Invite is a small automation service written on top of Golang.hr Platform."),
		"service-version":     getFloat(utils.GetFromEnvOr("HELLO_SERVICE_VERSION", "0.1")),
		"formatter":           "text",
		"level":               logrus.DebugLevel,
		"manager-interrupt-wait-timeout": getInt(utils.GetFromEnvOr("SLACK_SERVICE_MANAGER_INTERRUPT_TIMEOUT", "10")),
		"grpc-listen-forever":            getBool(utils.GetFromEnvOr("SLACK_SERVICE_GRPC_LISTEN_FOREVER", "true")),
		"grpc-addr":                      utils.GetFromEnvOr("SLACK_SERVICE_GRPC_ADDR", ":4772"),
		"grpc-tls":                       getBool(utils.GetFromEnvOr("SLACK_SERVICE_GRPC_TLS", "true")),
		"grpc-tls-domain":                utils.GetFromEnvOr("SLACK_SERVICE_GRPC_TLS_DOMAIN", "golang.hr"),
		"grpc-rest-addr":                 utils.GetFromEnvOr("SLACK_SERVICE_REST_ADDR", ":8500"),
		"grpc-rest-listen-forever":       getBool(utils.GetFromEnvOr("SLACK_SERVICE_REST_LISTEN_FOREVER", "true")),
		"http-addr":                      utils.GetFromEnvOr("SLACK_SERVICE_HTTP_ADDR", ":8800"),
		"http-listen-forever":            getBool(utils.GetFromEnvOr("SLACK_SERVICE_HTTP_LISTEN_FOREVER", "true")),
		"slack-team-name":                utils.GetFromEnvOr("SLACK_TEAM_NAME", "golanghr"),
		"slack-token":                    utils.GetFromEnvOr("SLACK_TOKEN", ""),
コード例 #4
0
ファイル: options.go プロジェクト: golanghr/platform-examples
SOFTWARE.
*/

// Package main ...
package main

import (
	"strconv"

	"github.com/Sirupsen/logrus"
	"github.com/golanghr/platform/utils"
)

var (
	serviceOptions = map[string]interface{}{
		"service-name":        utils.GetFromEnvOr("HELLO_SERVICE_NAME", "Hello World"),
		"service-description": utils.GetFromEnvOr("HELLO_SERVICE_DESCRIPTION", "Basic Golang.Hr Platform hello world example service written for easier understanding of how to run and work with platform"),
		"service-version":     getFloat(utils.GetFromEnvOr("HELLO_SERVICE_VERSION", "0.1")),
		"formatter":           "text",
		"level":               logrus.DebugLevel,
		"manager-interrupt-wait-timeout": getInt(utils.GetFromEnvOr("HELLO_SERVICE_MANAGER_INTERRUPT_TIMEOUT", "1")),
		"grpc-listen-forever":            getBool(utils.GetFromEnvOr("HELLO_SERVICE_GRPC_LISTEN_FOREVER", "true")),
		"grpc-addr":                      utils.GetFromEnvOr("HELLO_SERVICE_GRPC_ADDR", ":4778"),
		"grpc-tls":                       getBool(utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS", "true")),
		"grpc-tls-domain":                utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_DOMAIN", "golang.hr"),
		"grpc-tls-cert":                  utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_CERT", "test_data/server.crt"),
		"grpc-tls-key":                   utils.GetFromEnvOr("HELLO_SERVICE_GRPC_TLS_KEY", "test_data/server.key"),
		"http-addr":                      utils.GetFromEnvOr("HELLO_SERVICE_HTTP_ADDR", ":8070"),
		"http-listen-forever":            getBool(utils.GetFromEnvOr("HELLO_SERVICE_HTTP_LISTEN_FOREVER", "true")),
	}
)