Documentation ¶
Overview ¶
Package m3admin is a generated GoMock package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotOk indicates that HTTP status was not Ok ErrNotOk = errors.New("status not ok") // ErrNotFound indicates that HTTP status was not found ErrNotFound = errors.New("status not found") // ErrMethodNotAllowed indicates that HTTP status was method not allowed ErrMethodNotAllowed = errors.New("method not allowed") )
Functions ¶
func JSONPBMarshal ¶ added in v0.3.0
JSONPBMarshal marshals a JSON protobuf message, just using defaults for the marshaller currently.
func JSONPBUnmarshal ¶ added in v0.3.0
JSONPBUnmarshal unmarshals a JSON protobuf message, allowing for backwards compatible changes by allowing unknown fields to exist when unmarshalling response (new fields will get added and need to be able to be unmarshalled by an old operator calling endpoints on a new coordinator or DB node).
Types ¶
type Client ¶
type Client interface { DoHTTPRequest(action, url string, data *bytes.Buffer, opts ...RequestOption) (*http.Response, error) DoHTTPJSONPBRequest(action, url string, request, response proto.Message, opts ...RequestOption) error }
Client is an m3admin client.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) DoHTTPJSONPBRequest ¶ added in v0.3.0
func (m *MockClient) DoHTTPJSONPBRequest(action, url string, request, response proto.Message, opts ...RequestOption) error
DoHTTPJSONPBRequest mocks base method.
func (*MockClient) DoHTTPRequest ¶
func (m *MockClient) DoHTTPRequest(action, url string, data *bytes.Buffer, opts ...RequestOption) (*http.Response, error)
DoHTTPRequest mocks base method.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) DoHTTPJSONPBRequest ¶ added in v0.3.0
func (mr *MockClientMockRecorder) DoHTTPJSONPBRequest(action, url, request, response interface{}, opts ...interface{}) *gomock.Call
DoHTTPJSONPBRequest indicates an expected call of DoHTTPJSONPBRequest.
func (*MockClientMockRecorder) DoHTTPRequest ¶
func (mr *MockClientMockRecorder) DoHTTPRequest(action, url, data interface{}, opts ...interface{}) *gomock.Call
DoHTTPRequest indicates an expected call of DoHTTPRequest.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures an m3admin client.
func WithEnvironment ¶ added in v0.2.0
WithEnvironment controls the Cluster-Environment-Name header to m3coordinator.
func WithHTTPClient ¶
WithHTTPClient configures an http client for the m3admin client. If not set, go-retryablehttp's default client will be used. Note that the retry client's logger will be overridden with the stdlog-wrapped wrapped zap logger.
func WithLogger ¶
WithLogger configures a logger for the client. If not set a noop logger will be used.
type RequestOption ¶ added in v0.4.0
type RequestOption interface {
// contains filtered or unexported methods
}
RequestOption defines a per-request option.
func WithHeader ¶ added in v0.4.0
func WithHeader(name, value string) RequestOption
WithHeader adds a header to a request. It can be specified multiple times.
Directories ¶
Path | Synopsis |
---|---|
Package namespace is a generated GoMock package.
|
Package namespace is a generated GoMock package. |
Package placement is a generated GoMock package.
|
Package placement is a generated GoMock package. |
Package topic is a generated GoMock package.
|
Package topic is a generated GoMock package. |