store

package
v0.5.0-tke.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateClusterName added in v0.4.0

func GenerateClusterName(base string) string

func RegisterFactory

func RegisterFactory(storeType string, factoryFunc Factory)

Types

type Cluster

type Cluster struct {
	// Cluster Id must be unique
	Id string `json:"id"`
	// Cluster name
	Name string `json:"name"`
	// Crane server url in the cluster
	CraneUrl string `json:"craneUrl"`
	// Grafana url in the cluster
	GrafanaUrl string `json:"grafanaUrl"`
}

Cluster define the craned endpoint and information about the cluster the craned deployed in

func (Cluster) CraneUrlDuplicated added in v0.4.0

func (c Cluster) CraneUrlDuplicated(store map[string]*Cluster) bool

type ClusterList

type ClusterList struct {
	TotalCount int32      `json:"totalCount"`
	Items      []*Cluster `json:"items"`
}

type ClusterStore

type ClusterStore interface {
	AddCluster(ctx context.Context, cluster *Cluster) error
	DeleteCluster(ctx context.Context, clusterid string) error
	UpdateCluster(ctx context.Context, cluster *Cluster) error
	GetCluster(ctx context.Context, clusterid string) (*Cluster, error)
	ListClusters(ctx context.Context) (*ClusterList, error)
	ListNamespaces(ctx context.Context, clusterid string) (*NamespaceList, error)
}

ClusterStore define the cluster store CURD interface

type Factory

type Factory func(cfg interface{}) (Store, error)

type MockClusterStore

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

MockClusterStore is a mock of ClusterStore interface.

func NewMockClusterStore

func NewMockClusterStore(ctrl *gomock.Controller) *MockClusterStore

NewMockClusterStore creates a new mock instance.

func (*MockClusterStore) AddCluster

func (m *MockClusterStore) AddCluster(arg0 context.Context, arg1 *Cluster) error

AddCluster mocks base method.

func (*MockClusterStore) DeleteCluster

func (m *MockClusterStore) DeleteCluster(arg0 context.Context, arg1 string) error

DeleteCluster mocks base method.

func (*MockClusterStore) EXPECT

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

func (*MockClusterStore) GetCluster

func (m *MockClusterStore) GetCluster(arg0 context.Context, arg1 string) (*Cluster, error)

GetCluster mocks base method.

func (*MockClusterStore) ListClusters

func (m *MockClusterStore) ListClusters(arg0 context.Context) (*ClusterList, error)

ListClusters mocks base method.

func (*MockClusterStore) ListNamespaces added in v0.5.0

func (m *MockClusterStore) ListNamespaces(arg0 context.Context, arg1 string) (*NamespaceList, error)

ListNamespaces mocks base method.

func (*MockClusterStore) UpdateCluster

func (m *MockClusterStore) UpdateCluster(arg0 context.Context, arg1 *Cluster) error

UpdateCluster mocks base method.

type MockClusterStoreMockRecorder

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

MockClusterStoreMockRecorder is the mock recorder for MockClusterStore.

func (*MockClusterStoreMockRecorder) AddCluster

func (mr *MockClusterStoreMockRecorder) AddCluster(arg0, arg1 interface{}) *gomock.Call

AddCluster indicates an expected call of AddCluster.

func (*MockClusterStoreMockRecorder) DeleteCluster

func (mr *MockClusterStoreMockRecorder) DeleteCluster(arg0, arg1 interface{}) *gomock.Call

DeleteCluster indicates an expected call of DeleteCluster.

func (*MockClusterStoreMockRecorder) GetCluster

func (mr *MockClusterStoreMockRecorder) GetCluster(arg0, arg1 interface{}) *gomock.Call

GetCluster indicates an expected call of GetCluster.

func (*MockClusterStoreMockRecorder) ListClusters

func (mr *MockClusterStoreMockRecorder) ListClusters(arg0 interface{}) *gomock.Call

ListClusters indicates an expected call of ListClusters.

func (*MockClusterStoreMockRecorder) ListNamespaces added in v0.5.0

func (mr *MockClusterStoreMockRecorder) ListNamespaces(arg0, arg1 interface{}) *gomock.Call

ListNamespaces indicates an expected call of ListNamespaces.

func (*MockClusterStoreMockRecorder) UpdateCluster

func (mr *MockClusterStoreMockRecorder) UpdateCluster(arg0, arg1 interface{}) *gomock.Call

UpdateCluster indicates an expected call of UpdateCluster.

type MockStore

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

MockStore is a mock of Store interface.

func NewMockStore

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance.

func (*MockStore) Clusters

func (m *MockStore) Clusters() ClusterStore

Clusters mocks base method.

func (*MockStore) EXPECT

func (m *MockStore) EXPECT() *MockStoreMockRecorder

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

type MockStoreMockRecorder

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

MockStoreMockRecorder is the mock recorder for MockStore.

func (*MockStoreMockRecorder) Clusters

func (mr *MockStoreMockRecorder) Clusters() *gomock.Call

Clusters indicates an expected call of Clusters.

type NamespaceList added in v0.4.0

type NamespaceList struct {
	TotalCount int      `json:"totalCount"`
	Items      []string `json:"items"`
}

type Store

type Store interface {
	Clusters() ClusterStore
}

func GetStore

func GetStore(storeType string) (Store, error)

func InitStore

func InitStore(storeType string, cfg interface{}) (Store, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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