m3admin

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package m3admin is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
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

func JSONPBMarshal(w io.Writer, msg proto.Message) error

JSONPBMarshal marshals a JSON protobuf message, just using defaults for the marshaller currently.

func JSONPBUnmarshal added in v0.3.0

func JSONPBUnmarshal(r io.Reader, msg proto.Message) error

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.

func NewClient

func NewClient(clientOpts ...Option) Client

NewClient returns a new 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

func WithEnvironment(e string) Option

WithEnvironment controls the Cluster-Environment-Name header to m3coordinator.

func WithHTTPClient

func WithHTTPClient(cl *retryhttp.Client) Option

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

func WithLogger(l *zap.Logger) Option

WithLogger configures a logger for the client. If not set a noop logger will be used.

func WithZone added in v0.14.0

func WithZone(z string) Option

WithZone controls the Cluster-Zone-Name header to m3coordinator.

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.

Jump to

Keyboard shortcuts

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