package
0.0.0-20180911183212-0f8974794783
Repository: https://github.com/levenlabs/golib.git
Documentation: pkg.go.dev
# Functions
AddCORSHeaders accepts a http.Handler and returns a http.Handler that adds CORS headers when an Origin is sent.
ContextApply takes the context and adds information from it to the given Request, so that if the Request is sent to another genapi the Context will be propogated.
ContextKV returns the llog.KV associated with the given context, which was presumably returned from RequestContext.
ContextMergeKV returns a context with the given set of llog.KVs merged into it.
HTTPDefaultClient returns a *http.Client with sane defaults that can be overridden on a case-by-case basis if you can't use http.DefaultClient.
RetryCaller returns a Caller which wraps the given one, passing all Calls back to it.
Version compiles the build strings into a string which will be printed out when --version is used in a GenAPI instance, but is exposed so it may be used other places too.
# Variables
Build variables which can be set during the go build command.
Build variables which can be set during the go build command.
Build variables which can be set during the go build command.
# Structs
GenAPI is a type used to handle most of the generic logic we always implement when making an RPC API endpoint.
MongoInfo contains information needed by the api to interact with a mongo backend, and also houses the connection to that backend (which can be interacted with through its methods).
OkqInfo is used to tell the api to interact with a set of okq instances.
RedisInfo is used to tell the api to interact with a redis backend, and also houses the connection to that backend.
TLSInfo is used to tell the api to use TLS (e.g.
# Type aliases
CallerStub provides a convenient way to make stubbed endpoints for testing.
InitFunc is just a helper for a function that accepts a GenAPI pointer.