package
0.0.0-20210528075739-2d572df9eb54
Repository: https://github.com/cga1123/bissy-api.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
JSONBody returns the serialized JSON of the given value as a *bytes.Reader Useful for populating HTTP request bodies.
NewTestHTTPClient creates a new TestHTTPClient struct.
ParseJSONBody parse the given body into target using a JSON Decoder.
RequireEnv takes a variable number of environment variables and ensures they are all set.
TestDB returns a test db connection.
TestRedis returns a test redis connection.
# Structs
RealClock Implements Clock by delegating to time.Now().
SecureRandom implements Random using the crypto/rand package.
TestClock implements Clock with a constant value.
TestHTTPClient struct represents a mocked HTTPClient.
TestIDGenerator implements IDGenerator with a constant value.
TestRandom implements the Random implementation by returning a known value.
UUIDGenerator implements IdGenerator via google/uuid generation.
# Interfaces
The Clock interface implements Now(), useful in order to inject specific times during testing.
HTTPClient describes the interface for an HTTP client.
IDGenerator interface is used to implement uuid generators.
Random describes an interface to get random strings and bytes.