store

package
v0.0.0-...-3266887 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 5 Imported by: 0

Documentation

Overview

Package store defines the storage interface for iam-apiserver.

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetClient

func SetClient(factory Factory)

SetClient set the iam store client.

Types

type Factory

type Factory interface {
	Users() UserStore
	Secrets() SecretStore
	Policies() PolicyStore
	PolicyAudits() PolicyAuditStore
	Close() error
}

Factory defines the iam platform storage interface.

func Client

func Client() Factory

Client return the store client instance.

type MockFactory

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

MockFactory is a mock of Factory interface.

func NewMockFactory

func NewMockFactory(ctrl *gomock.Controller) *MockFactory

NewMockFactory creates a new mock instance.

func (*MockFactory) Close

func (m *MockFactory) Close() error

Close mocks base method.

func (*MockFactory) EXPECT

func (m *MockFactory) EXPECT() *MockFactoryMockRecorder

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

func (*MockFactory) Policies

func (m *MockFactory) Policies() PolicyStore

Policies mocks base method.

func (*MockFactory) PolicyAudits

func (m *MockFactory) PolicyAudits() PolicyAuditStore

PolicyAudits mocks base method.

func (*MockFactory) Secrets

func (m *MockFactory) Secrets() SecretStore

Secrets mocks base method.

func (*MockFactory) Users

func (m *MockFactory) Users() UserStore

Users mocks base method.

type MockFactoryMockRecorder

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

MockFactoryMockRecorder is the mock recorder for MockFactory.

func (*MockFactoryMockRecorder) Close

func (mr *MockFactoryMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockFactoryMockRecorder) Policies

func (mr *MockFactoryMockRecorder) Policies() *gomock.Call

Policies indicates an expected call of Policies.

func (*MockFactoryMockRecorder) PolicyAudits

func (mr *MockFactoryMockRecorder) PolicyAudits() *gomock.Call

PolicyAudits indicates an expected call of PolicyAudits.

func (*MockFactoryMockRecorder) Secrets

func (mr *MockFactoryMockRecorder) Secrets() *gomock.Call

Secrets indicates an expected call of Secrets.

func (*MockFactoryMockRecorder) Users

func (mr *MockFactoryMockRecorder) Users() *gomock.Call

Users indicates an expected call of Users.

type MockPolicyStore

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

MockPolicyStore is a mock of PolicyStore interface.

func NewMockPolicyStore

func NewMockPolicyStore(ctrl *gomock.Controller) *MockPolicyStore

NewMockPolicyStore creates a new mock instance.

func (*MockPolicyStore) Create

func (m *MockPolicyStore) Create(arg0 context.Context, arg1 *v1.Policy, arg2 v10.CreateOptions) error

Create mocks base method.

func (*MockPolicyStore) Delete

func (m *MockPolicyStore) Delete(arg0 context.Context, arg1, arg2 string, arg3 v10.DeleteOptions) error

Delete mocks base method.

func (*MockPolicyStore) DeleteCollection

func (m *MockPolicyStore) DeleteCollection(arg0 context.Context, arg1 string, arg2 []string, arg3 v10.DeleteOptions) error

DeleteCollection mocks base method.

func (*MockPolicyStore) EXPECT

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

func (*MockPolicyStore) Get

func (m *MockPolicyStore) Get(arg0 context.Context, arg1, arg2 string, arg3 v10.GetOptions) (*v1.Policy, error)

Get mocks base method.

func (*MockPolicyStore) List

func (m *MockPolicyStore) List(arg0 context.Context, arg1 string, arg2 v10.ListOptions) (*v1.PolicyList, error)

List mocks base method.

func (*MockPolicyStore) Update

func (m *MockPolicyStore) Update(arg0 context.Context, arg1 *v1.Policy, arg2 v10.UpdateOptions) error

Update mocks base method.

type MockPolicyStoreMockRecorder

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

MockPolicyStoreMockRecorder is the mock recorder for MockPolicyStore.

func (*MockPolicyStoreMockRecorder) Create

func (mr *MockPolicyStoreMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockPolicyStoreMockRecorder) Delete

func (mr *MockPolicyStoreMockRecorder) Delete(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockPolicyStoreMockRecorder) DeleteCollection

func (mr *MockPolicyStoreMockRecorder) DeleteCollection(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

DeleteCollection indicates an expected call of DeleteCollection.

func (*MockPolicyStoreMockRecorder) Get

func (mr *MockPolicyStoreMockRecorder) Get(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockPolicyStoreMockRecorder) List

func (mr *MockPolicyStoreMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockPolicyStoreMockRecorder) Update

func (mr *MockPolicyStoreMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockSecretStore

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

MockSecretStore is a mock of SecretStore interface.

func NewMockSecretStore

func NewMockSecretStore(ctrl *gomock.Controller) *MockSecretStore

NewMockSecretStore creates a new mock instance.

func (*MockSecretStore) Create

func (m *MockSecretStore) Create(arg0 context.Context, arg1 *v1.Secret, arg2 v10.CreateOptions) error

Create mocks base method.

func (*MockSecretStore) Delete

func (m *MockSecretStore) Delete(arg0 context.Context, arg1, arg2 string, arg3 v10.DeleteOptions) error

Delete mocks base method.

func (*MockSecretStore) DeleteCollection

func (m *MockSecretStore) DeleteCollection(arg0 context.Context, arg1 string, arg2 []string, arg3 v10.DeleteOptions) error

DeleteCollection mocks base method.

func (*MockSecretStore) EXPECT

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

func (*MockSecretStore) Get

func (m *MockSecretStore) Get(arg0 context.Context, arg1, arg2 string, arg3 v10.GetOptions) (*v1.Secret, error)

Get mocks base method.

func (*MockSecretStore) List

func (m *MockSecretStore) List(arg0 context.Context, arg1 string, arg2 v10.ListOptions) (*v1.SecretList, error)

List mocks base method.

func (*MockSecretStore) Update

func (m *MockSecretStore) Update(arg0 context.Context, arg1 *v1.Secret, arg2 v10.UpdateOptions) error

Update mocks base method.

type MockSecretStoreMockRecorder

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

MockSecretStoreMockRecorder is the mock recorder for MockSecretStore.

func (*MockSecretStoreMockRecorder) Create

func (mr *MockSecretStoreMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockSecretStoreMockRecorder) Delete

func (mr *MockSecretStoreMockRecorder) Delete(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockSecretStoreMockRecorder) DeleteCollection

func (mr *MockSecretStoreMockRecorder) DeleteCollection(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

DeleteCollection indicates an expected call of DeleteCollection.

func (*MockSecretStoreMockRecorder) Get

func (mr *MockSecretStoreMockRecorder) Get(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockSecretStoreMockRecorder) List

func (mr *MockSecretStoreMockRecorder) List(arg0, arg1, arg2 interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockSecretStoreMockRecorder) Update

func (mr *MockSecretStoreMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockUserStore

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

MockUserStore is a mock of UserStore interface.

func NewMockUserStore

func NewMockUserStore(ctrl *gomock.Controller) *MockUserStore

NewMockUserStore creates a new mock instance.

func (*MockUserStore) Create

func (m *MockUserStore) Create(arg0 context.Context, arg1 *v1.User, arg2 v10.CreateOptions) error

Create mocks base method.

func (*MockUserStore) Delete

func (m *MockUserStore) Delete(arg0 context.Context, arg1 string, arg2 v10.DeleteOptions) error

Delete mocks base method.

func (*MockUserStore) DeleteCollection

func (m *MockUserStore) DeleteCollection(arg0 context.Context, arg1 []string, arg2 v10.DeleteOptions) error

DeleteCollection mocks base method.

func (*MockUserStore) EXPECT

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

func (*MockUserStore) Get

func (m *MockUserStore) Get(arg0 context.Context, arg1 string, arg2 v10.GetOptions) (*v1.User, error)

Get mocks base method.

func (*MockUserStore) List

func (m *MockUserStore) List(arg0 context.Context, arg1 v10.ListOptions) (*v1.UserList, error)

List mocks base method.

func (*MockUserStore) Update

func (m *MockUserStore) Update(arg0 context.Context, arg1 *v1.User, arg2 v10.UpdateOptions) error

Update mocks base method.

type MockUserStoreMockRecorder

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

MockUserStoreMockRecorder is the mock recorder for MockUserStore.

func (*MockUserStoreMockRecorder) Create

func (mr *MockUserStoreMockRecorder) Create(arg0, arg1, arg2 interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockUserStoreMockRecorder) Delete

func (mr *MockUserStoreMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockUserStoreMockRecorder) DeleteCollection

func (mr *MockUserStoreMockRecorder) DeleteCollection(arg0, arg1, arg2 interface{}) *gomock.Call

DeleteCollection indicates an expected call of DeleteCollection.

func (*MockUserStoreMockRecorder) Get

func (mr *MockUserStoreMockRecorder) Get(arg0, arg1, arg2 interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockUserStoreMockRecorder) List

func (mr *MockUserStoreMockRecorder) List(arg0, arg1 interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockUserStoreMockRecorder) Update

func (mr *MockUserStoreMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call

Update indicates an expected call of Update.

type PolicyAuditStore

type PolicyAuditStore interface {
	ClearOutdated(ctx context.Context, maxReserveDays int) (int64, error)
}

PolicyAuditStore defines the policy_audit storage interface.

type PolicyStore

type PolicyStore interface {
	Create(ctx context.Context, policy *v1.Policy, opts metav1.CreateOptions) error
	Update(ctx context.Context, policy *v1.Policy, opts metav1.UpdateOptions) error
	Delete(ctx context.Context, username string, name string, opts metav1.DeleteOptions) error
	DeleteCollection(ctx context.Context, username string, names []string, opts metav1.DeleteOptions) error
	Get(ctx context.Context, username string, name string, opts metav1.GetOptions) (*v1.Policy, error)
	List(ctx context.Context, username string, opts metav1.ListOptions) (*v1.PolicyList, error)
}

PolicyStore defines the policy storage interface.

type SecretStore

type SecretStore interface {
	Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) error
	Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) error
	Delete(ctx context.Context, username, secretID string, opts metav1.DeleteOptions) error
	DeleteCollection(ctx context.Context, username string, secretIDs []string, opts metav1.DeleteOptions) error
	Get(ctx context.Context, username, secretID string, opts metav1.GetOptions) (*v1.Secret, error)
	List(ctx context.Context, username string, opts metav1.ListOptions) (*v1.SecretList, error)
}

SecretStore defines the secret storage interface.

type UserStore

type UserStore interface {
	Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) error
	Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) error
	Delete(ctx context.Context, username string, opts metav1.DeleteOptions) error
	DeleteCollection(ctx context.Context, usernames []string, opts metav1.DeleteOptions) error
	Get(ctx context.Context, username string, opts metav1.GetOptions) (*v1.User, error)
	List(ctx context.Context, opts metav1.ListOptions) (*v1.UserList, error)
}

UserStore defines the user storage interface.

Directories

Path Synopsis
Package etcd implements `github.com/marmotedu/iam/internal/apiserver/store.Store` interface.
Package etcd implements `github.com/marmotedu/iam/internal/apiserver/store.Store` interface.
Package fake implements `github.com/marmotedu/iam/internal/apiserver/store.Store` interface.
Package fake implements `github.com/marmotedu/iam/internal/apiserver/store.Store` interface.
Package mysql implements `github.com/marmotedu/iam/internal/apiserver/store.Store` interface.
Package mysql implements `github.com/marmotedu/iam/internal/apiserver/store.Store` interface.

Jump to

Keyboard shortcuts

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