Documentation ¶
Index ¶
- Variables
- type TestClient
- func (tc *TestClient) Close(ctx context.Context) error
- func (tc *TestClient) GetBool(_ context.Context, namespace, key string) (bool, error)
- func (tc *TestClient) GetFloat(_ context.Context, namespace, key string) (float64, error)
- func (tc *TestClient) GetInt(_ context.Context, namespace, key string) (int64, error)
- func (tc *TestClient) GetJSON(_ context.Context, namespace, key string, result interface{}) error
- func (tc *TestClient) GetProto(_ context.Context, namespace, key string, result proto.Message) error
- func (tc *TestClient) GetString(_ context.Context, namespace, key string) (string, error)
- func (tc *TestClient) WithBool(namespace, key string, value bool) *TestClient
- func (tc *TestClient) WithError(namespace, key string, err error) *TestClient
- func (tc *TestClient) WithFloat(namespace, key string, value float64) *TestClient
- func (tc *TestClient) WithInt(namespace, key string, value int64) *TestClient
- func (tc *TestClient) WithJSON(namespace, key string, value []byte) *TestClient
- func (tc *TestClient) WithProto(namespace, key string, value []byte) *TestClient
- func (tc *TestClient) WithString(namespace, key string, value string) *TestClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("config not found") ErrTypeMismatch = errors.New("type mismatch") )
Functions ¶
This section is empty.
Types ¶
type TestClient ¶
type TestClient struct {
// contains filtered or unexported fields
}
TestClient is an in-memory configuration store intended for use in unit tests. It conforms to the See client_test.go for examples on how to use it.
func NewTestClient ¶
func NewTestClient() *TestClient
Constructs a TestClient for use in unit tests.
func (*TestClient) GetJSON ¶
func (tc *TestClient) GetJSON(_ context.Context, namespace, key string, result interface{}) error
func (*TestClient) WithBool ¶
func (tc *TestClient) WithBool(namespace, key string, value bool) *TestClient
func (*TestClient) WithError ¶
func (tc *TestClient) WithError(namespace, key string, err error) *TestClient
func (*TestClient) WithFloat ¶
func (tc *TestClient) WithFloat(namespace, key string, value float64) *TestClient
func (*TestClient) WithInt ¶
func (tc *TestClient) WithInt(namespace, key string, value int64) *TestClient
func (*TestClient) WithJSON ¶
func (tc *TestClient) WithJSON(namespace, key string, value []byte) *TestClient
Accepts a JSON-serialized byte array
func (*TestClient) WithProto ¶
func (tc *TestClient) WithProto(namespace, key string, value []byte) *TestClient
Accepts a proto-serialized byte array
func (*TestClient) WithString ¶
func (tc *TestClient) WithString(namespace, key string, value string) *TestClient
Click to show internal directories.
Click to hide internal directories.