namespace

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: 16 Imported by: 0

Documentation

Overview

Package namespace is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestFromSpec

func RequestFromSpec(ns myspec.Namespace) (*admin.NamespaceAddRequest, error)

RequestFromSpec returns a namespace add request from a cluster spec namespace config.

Types

type Client

type Client interface {
	// Create will create a namepace for the given request.
	Create(request *admin.NamespaceAddRequest) error
	// List will retrieve all namespaces in the current cluster. The registry in
	// the namespace response is guaranteed to be non-nil if err == nil.
	List() (*admin.NamespaceGetResponse, error)
	// Delete will delete a namespace given a name
	Delete(namespace string) error
	// Ready will attempt to mark a namespace as ready.
	Ready(request *admin.NamespaceReadyRequest) error
}

Client provides the interface to interact with the namespace API

func NewClient

func NewClient(opts ...Option) (Client, error)

NewClient constructs a new namespace 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) Create

func (m *MockClient) Create(request *admin.NamespaceAddRequest) error

Create mocks base method.

func (*MockClient) Delete

func (m *MockClient) Delete(namespace string) error

Delete mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) List

List mocks base method.

func (*MockClient) Ready added in v0.11.0

func (m *MockClient) Ready(request *admin.NamespaceReadyRequest) error

Ready mocks base method.

type MockClientMockRecorder

type MockClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Create

func (mr *MockClientMockRecorder) Create(request interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockClientMockRecorder) Delete

func (mr *MockClientMockRecorder) Delete(namespace interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockClientMockRecorder) List

func (mr *MockClientMockRecorder) List() *gomock.Call

List indicates an expected call of List.

func (*MockClientMockRecorder) Ready added in v0.11.0

func (mr *MockClientMockRecorder) Ready(request interface{}) *gomock.Call

Ready indicates an expected call of Ready.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides an interface that can be used for setter options with the constructor

func WithClient

func WithClient(cl m3admin.Client) Option

WithClient configures an m3admin client.

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger is a setter to override the default logger

func WithURL

func WithURL(u string) Option

WithURL is a setter to override the default url of m3coordinator

type Preset

type Preset string

Preset represents a predfined namespace.

const (
	// PresetTenSecondsTwoDaysIndexed stores metrics at 10 second resolution for
	// two days with a block size of 2h. BufferPast and BufferFuture are both 10m.
	// Snapshotting is enabled. Metrics are indexed based on tags.
	PresetTenSecondsTwoDaysIndexed Preset = "10s:2d"

	// PresetOneMinuteFourtyDaysIndexed stores metrics at 10 second resolution for
	// two days with a block size of 2h. BufferPast and BufferFuture are both 10m.
	// Snapshotting is enabled. Metrics are indexed based on tags.
	PresetOneMinuteFourtyDaysIndexed Preset = "1m:40d"
)

Jump to

Keyboard shortcuts

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