service

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HttpHost          = golenv.OverrideIfEnv("TYSON_HTTP_HOST", "http://127.0.0.1:8080")
	HttpAuthToken     = golenv.OverrideIfEnv("TYSON_HTTP_AUTH_TOKEN", "")
	HttpPath          = golenv.OverrideIfEnv("TYSON_HTTP_PATH", "/")
	HttpMethod        = golenv.OverrideIfEnv("TYSON_HTTP_METHOD", "GET")
	HttpReqBodyFile   = golenv.OverrideIfEnv("TYSON_HTTP_REQ_BODY_FILE", "")
	HttpParams        = golenv.OverrideIfEnv("TYSON_HTTP_PARAMS", "")
	HttpHeaders       = golenv.OverrideIfEnv("TYSON_HTTP_HEADERS", "X-REQUEST-FOR:perf,X-REQUEST-FROM:tyson")
	HttpSkipSSLVerify = golconv.StringToBool(golenv.OverrideIfEnv("TYSON_SKIP_SSL_VERIFY", ""), true)
)
View Source
var (
	RedisHost      = golenv.OverrideIfEnv("TYSON_REDIS_HOST", "127.0.0.1:6379")
	RedisPassword  = golenv.OverrideIfEnv("TYSON_REDIS_PASSWORD", "")
	RedisDB        = golenv.OverrideIfEnv("TYSON_REDIS_DB", "0")
	RedisKey       = golenv.OverrideIfEnv("TYSON_REDIS_KEY", "tyson")
	RedisKeyExpiry = time.Duration(golconv.StringToInt(golenv.OverrideIfEnv("TYSON_REDIS_KEY_EXPIRY", ""), 0))
	RedisValPrefix = golenv.OverrideIfEnv("TYSON_REDIS_VALUE_PREFIX", "peek-a-boo")
	RedisCall      = golenv.OverrideIfEnv("TYSON_REDIS_CALL", "set")

	RedisCalls = map[string]func(int, *sync.WaitGroup){}
)
View Source
var (
	ConcurrencyLimit = golconv.StringToInt(golenv.OverrideIfEnv("TYSON_CONCURRENCY_LIMIT", ""), 1000)
	MaxRequests      = golconv.StringToInt(golenv.OverrideIfEnv("TYSON_MAX_REQUESTS", ""), 5000000)
)
View Source
var ServiceEngines = make(map[string]Service)

ServiceEngines acts as map for all available service-engines.

Functions

func RegisterService

func RegisterService(name string, service Service)

RegisterService gets used by adapters to register themselves.

Types

type HttpService added in v0.1.3

type HttpService struct {
	Client     *golhttpclient.HTTPRequest
	StartTime  time.Time
	EndTime    time.Time
	ErrorCount uint64
	sync.Mutex
}

func (*HttpService) Execute added in v0.1.3

func (svc *HttpService) Execute()

func (*HttpService) Help added in v0.1.3

func (svc *HttpService) Help()

func (*HttpService) Ping added in v0.1.3

func (svc *HttpService) Ping() error

type RedisService

type RedisService struct {
	Client     *redis.Client
	StartTime  time.Time
	EndTime    time.Time
	ErrorCount uint64
	sync.Mutex
}

func (*RedisService) Execute

func (svc *RedisService) Execute()

func (*RedisService) Help

func (svc *RedisService) Help()

func (*RedisService) Ping

func (svc *RedisService) Ping() error

type Service

type Service interface {
	Ping() error
	Execute()
	Help()
}

func GetService

func GetService(name string) Service

GetService gets used by client to fetch a required db-engine.

Jump to

Keyboard shortcuts

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