mockstore

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStore

type MockStore struct {
	mock.Mock
}

MockStore is a store used for testing. When using the MockStore in unit tests, stub out the behavior you wish to test against by assigning the appropriate function to the appropriate Func field. If you have forgotten to stub a particular function, the program will panic.

func (*MockStore) AllowTokens

func (s *MockStore) AllowTokens(tokens ...*jwt.Token) error

CreateToken ...

func (*MockStore) AuthenticateUser

func (s *MockStore) AuthenticateUser(
	ctx context.Context,
	username, password string,
) (*types.User, error)

AuthenticateUser ...

func (*MockStore) CreateClusterID

func (s *MockStore) CreateClusterID(ctx context.Context, id string) error

CreateClusterID ...

func (*MockStore) CreateClusterRole

func (s *MockStore) CreateClusterRole(ctx context.Context, clusterRole *types.ClusterRole) error

CreateClusterRole ...

func (*MockStore) CreateClusterRoleBinding

func (s *MockStore) CreateClusterRoleBinding(ctx context.Context, ClusterRoleBinding *types.ClusterRoleBinding) error

CreateClusterRoleBinding ...

func (*MockStore) CreateJWTSecret

func (s *MockStore) CreateJWTSecret(secret []byte) error

CreateJWTSecret ...

func (*MockStore) CreateNamespace

func (s *MockStore) CreateNamespace(ctx context.Context, org *types.Namespace) error

CreateNamespace ...

func (*MockStore) CreateOrUpdateClusterRole

func (s *MockStore) CreateOrUpdateClusterRole(ctx context.Context, clusterRole *types.ClusterRole) error

CreateOrUpdateClusterRole ...

func (*MockStore) CreateOrUpdateClusterRoleBinding

func (s *MockStore) CreateOrUpdateClusterRoleBinding(ctx context.Context, ClusterRoleBinding *types.ClusterRoleBinding) error

CreateOrUpdateClusterRoleBinding ...

func (*MockStore) CreateOrUpdateResource

func (s *MockStore) CreateOrUpdateResource(ctx context.Context, resource corev2.Resource) error

CreateOrUpdateResource ...

func (*MockStore) CreateOrUpdateRole

func (s *MockStore) CreateOrUpdateRole(ctx context.Context, role *types.Role) error

CreateOrUpdateRole ...

func (*MockStore) CreateOrUpdateRoleBinding

func (s *MockStore) CreateOrUpdateRoleBinding(ctx context.Context, RoleBinding *types.RoleBinding) error

CreateOrUpdateRoleBinding ...

func (*MockStore) CreateOrUpdateTessenConfig

func (s *MockStore) CreateOrUpdateTessenConfig(ctx context.Context, config *corev2.TessenConfig) error

CreateOrUpdateTessenConfig ...

func (*MockStore) CreateResource

func (s *MockStore) CreateResource(ctx context.Context, resource corev2.Resource) error

CreateResource ...

func (*MockStore) CreateRole

func (s *MockStore) CreateRole(ctx context.Context, role *types.Role) error

CreateRole ...

func (*MockStore) CreateRoleBinding

func (s *MockStore) CreateRoleBinding(ctx context.Context, RoleBinding *types.RoleBinding) error

CreateRoleBinding ...

func (*MockStore) CreateUser

func (s *MockStore) CreateUser(user *types.User) error

CreateUser ...

func (*MockStore) DeleteAssetByName

func (s *MockStore) DeleteAssetByName(ctx context.Context, name string) error

DeleteAssetByName ...

func (*MockStore) DeleteCheckConfigByName

func (s *MockStore) DeleteCheckConfigByName(ctx context.Context, name string) error

DeleteCheckConfigByName ...

func (*MockStore) DeleteClusterRole

func (s *MockStore) DeleteClusterRole(ctx context.Context, name string) error

DeleteClusterRole ...

func (*MockStore) DeleteClusterRoleBinding

func (s *MockStore) DeleteClusterRoleBinding(ctx context.Context, name string) error

DeleteClusterRoleBinding ...

func (*MockStore) DeleteEntity

func (s *MockStore) DeleteEntity(ctx context.Context, e *types.Entity) error

DeleteEntity ...

func (*MockStore) DeleteEntityByName

func (s *MockStore) DeleteEntityByName(ctx context.Context, id string) error

DeleteEntityByName ...

func (*MockStore) DeleteEventByEntityCheck

func (s *MockStore) DeleteEventByEntityCheck(ctx context.Context, entityName, checkID string) error

DeleteEventByEntityCheck ...

func (*MockStore) DeleteEventFilterByName

func (s *MockStore) DeleteEventFilterByName(ctx context.Context, name string) error

DeleteEventFilterByName ...

func (*MockStore) DeleteFailingKeepalive

func (s *MockStore) DeleteFailingKeepalive(ctx context.Context, entity *types.Entity) error

DeleteFailingKeepalive ...

func (*MockStore) DeleteHandlerByName

func (s *MockStore) DeleteHandlerByName(ctx context.Context, name string) error

DeleteHandlerByName ...

func (*MockStore) DeleteHookConfigByName

func (s *MockStore) DeleteHookConfigByName(ctx context.Context, name string) error

DeleteHookConfigByName ...

func (*MockStore) DeleteMutatorByName

func (s *MockStore) DeleteMutatorByName(ctx context.Context, name string) error

DeleteMutatorByName ...

func (*MockStore) DeleteNamespace

func (s *MockStore) DeleteNamespace(ctx context.Context, name string) error

DeleteNamespace ...

func (*MockStore) DeleteResource

func (s *MockStore) DeleteResource(ctx context.Context, kind, name string) error

DeleteResource ...

func (*MockStore) DeleteRole

func (s *MockStore) DeleteRole(ctx context.Context, name string) error

DeleteRole ...

func (*MockStore) DeleteRoleBinding

func (s *MockStore) DeleteRoleBinding(ctx context.Context, name string) error

DeleteRoleBinding ...

func (*MockStore) DeleteSilencedEntryByName

func (s *MockStore) DeleteSilencedEntryByName(ctx context.Context, silencedID ...string) error

DeleteSilencedEntryByName ...

func (*MockStore) DeleteUser

func (s *MockStore) DeleteUser(ctx context.Context, user *types.User) error

DeleteUser ...

func (*MockStore) DeregisterExtension

func (s *MockStore) DeregisterExtension(ctx context.Context, name string) error

func (*MockStore) GetAllUsers

func (s *MockStore) GetAllUsers(pred *store.SelectionPredicate) ([]*types.User, error)

GetAllUsers ...

func (*MockStore) GetAssetByName

func (s *MockStore) GetAssetByName(ctx context.Context, name string) (*types.Asset, error)

GetAssetByName ...

func (*MockStore) GetAssets

func (s *MockStore) GetAssets(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Asset, error)

GetAssets ...

func (*MockStore) GetCheckConfigByName

func (s *MockStore) GetCheckConfigByName(ctx context.Context, name string) (*types.CheckConfig, error)

GetCheckConfigByName ...

func (*MockStore) GetCheckConfigWatcher

func (s *MockStore) GetCheckConfigWatcher(ctx context.Context) <-chan store.WatchEventCheckConfig

GetCheckConfigWatcher ...

func (*MockStore) GetCheckConfigs

func (s *MockStore) GetCheckConfigs(ctx context.Context, pred *store.SelectionPredicate) ([]*types.CheckConfig, error)

GetCheckConfigs ...

func (*MockStore) GetClusterHealth

func (s *MockStore) GetClusterHealth(ctx context.Context, cluster clientv3.Cluster, etcdClientTLSConfig *tls.Config) *types.HealthResponse

GetClusterHealth ...

func (*MockStore) GetClusterID

func (s *MockStore) GetClusterID(ctx context.Context) (string, error)

GetClusterID ...

func (*MockStore) GetClusterRole

func (s *MockStore) GetClusterRole(ctx context.Context, name string) (*types.ClusterRole, error)

GetClusterRole ...

func (*MockStore) GetClusterRoleBinding

func (s *MockStore) GetClusterRoleBinding(ctx context.Context, name string) (*types.ClusterRoleBinding, error)

GetClusterRoleBinding ...

func (*MockStore) GetEntities

func (s *MockStore) GetEntities(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Entity, error)

GetEntities ...

func (*MockStore) GetEntityByName

func (s *MockStore) GetEntityByName(ctx context.Context, id string) (*types.Entity, error)

GetEntityByName ...

func (*MockStore) GetEntityWatcher

func (s *MockStore) GetEntityWatcher(ctx context.Context) <-chan store.WatchEventEntity

GetEntityWatcher

func (*MockStore) GetEventByEntityCheck

func (s *MockStore) GetEventByEntityCheck(ctx context.Context, entityName, checkID string) (*corev2.Event, error)

GetEventByEntityCheck ...

func (*MockStore) GetEventFilterByName

func (s *MockStore) GetEventFilterByName(ctx context.Context, name string) (*types.EventFilter, error)

GetEventFilterByName ...

func (*MockStore) GetEventFilters

func (s *MockStore) GetEventFilters(ctx context.Context, pred *store.SelectionPredicate) ([]*types.EventFilter, error)

GetEventFilters ...

func (*MockStore) GetEvents

func (s *MockStore) GetEvents(ctx context.Context, pred *store.SelectionPredicate) ([]*corev2.Event, error)

GetEvents ...

func (*MockStore) GetEventsByEntity

func (s *MockStore) GetEventsByEntity(ctx context.Context, entityName string, pred *store.SelectionPredicate) ([]*corev2.Event, error)

GetEventsByEntity ...

func (*MockStore) GetExtension

func (s *MockStore) GetExtension(ctx context.Context, name string) (*types.Extension, error)

func (*MockStore) GetExtensions

func (s *MockStore) GetExtensions(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Extension, error)

func (*MockStore) GetFailingKeepalives

func (s *MockStore) GetFailingKeepalives(ctx context.Context) ([]*types.KeepaliveRecord, error)

GetFailingKeepalives ...

func (*MockStore) GetHandlerByName

func (s *MockStore) GetHandlerByName(ctx context.Context, name string) (*types.Handler, error)

GetHandlerByName ...

func (*MockStore) GetHandlers

func (s *MockStore) GetHandlers(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Handler, error)

GetHandlers ...

func (*MockStore) GetHookConfigByName

func (s *MockStore) GetHookConfigByName(ctx context.Context, name string) (*types.HookConfig, error)

GetHookConfigByName ...

func (*MockStore) GetHookConfigs

func (s *MockStore) GetHookConfigs(ctx context.Context, pred *store.SelectionPredicate) ([]*types.HookConfig, error)

GetHookConfigs ...

func (*MockStore) GetJWTSecret

func (s *MockStore) GetJWTSecret() ([]byte, error)

GetJWTSecret ...

func (*MockStore) GetMutatorByName

func (s *MockStore) GetMutatorByName(ctx context.Context, name string) (*types.Mutator, error)

GetMutatorByName ...

func (*MockStore) GetMutators

func (s *MockStore) GetMutators(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Mutator, error)

GetMutators ...

func (*MockStore) GetNamespace

func (s *MockStore) GetNamespace(ctx context.Context, name string) (*types.Namespace, error)

GetNamespace ...

func (*MockStore) GetResource

func (s *MockStore) GetResource(ctx context.Context, name string, resource corev2.Resource) error

GetResource ...

func (*MockStore) GetRing

func (s *MockStore) GetRing(parts ...string) types.Ring

GetRing ...

func (*MockStore) GetRole

func (s *MockStore) GetRole(ctx context.Context, name string) (*types.Role, error)

GetRole ...

func (*MockStore) GetRoleBinding

func (s *MockStore) GetRoleBinding(ctx context.Context, name string) (*types.RoleBinding, error)

GetRoleBinding ...

func (*MockStore) GetSilencedEntries

func (s *MockStore) GetSilencedEntries(ctx context.Context) ([]*types.Silenced, error)

GetSilencedEntries ...

func (*MockStore) GetSilencedEntriesByCheckName

func (s *MockStore) GetSilencedEntriesByCheckName(ctx context.Context, checkName string) ([]*types.Silenced, error)

GetSilencedEntriesByCheckName ...

func (*MockStore) GetSilencedEntriesByName

func (s *MockStore) GetSilencedEntriesByName(ctx context.Context, names ...string) ([]*types.Silenced, error)

func (*MockStore) GetSilencedEntriesBySubscription

func (s *MockStore) GetSilencedEntriesBySubscription(ctx context.Context, subscriptions ...string) ([]*types.Silenced, error)

GetSilencedEntriesBySubscription ...

func (*MockStore) GetSilencedEntryByName

func (s *MockStore) GetSilencedEntryByName(ctx context.Context, silencedID string) (*types.Silenced, error)

GetSilencedEntryByName ...

func (*MockStore) GetTessenConfig

func (s *MockStore) GetTessenConfig(ctx context.Context) (*corev2.TessenConfig, error)

GetTessenConfig ...

func (*MockStore) GetTessenConfigWatcher

func (s *MockStore) GetTessenConfigWatcher(ctx context.Context) <-chan store.WatchEventTessenConfig

GetTessenConfigWatcher ...

func (*MockStore) GetToken

func (s *MockStore) GetToken(subject, id string) (*types.Claims, error)

GetToken ...

func (*MockStore) GetUser

func (s *MockStore) GetUser(ctx context.Context, username string) (*types.User, error)

GetUser ...

func (*MockStore) GetUsers

func (s *MockStore) GetUsers() ([]*types.User, error)

GetUsers ...

func (*MockStore) ListClusterRoleBindings

func (s *MockStore) ListClusterRoleBindings(ctx context.Context, pred *store.SelectionPredicate) ([]*types.ClusterRoleBinding, error)

ListClusterRoleBindings ...

func (*MockStore) ListClusterRoles

func (s *MockStore) ListClusterRoles(ctx context.Context, pred *store.SelectionPredicate) ([]*types.ClusterRole, error)

ListClusterRoles ...

func (*MockStore) ListNamespaces

func (s *MockStore) ListNamespaces(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Namespace, error)

ListNamespaces ...

func (*MockStore) ListResources

func (s *MockStore) ListResources(ctx context.Context, kind string, list interface{}, pred *store.SelectionPredicate) error

ListResources ...

func (*MockStore) ListRoleBindings

func (s *MockStore) ListRoleBindings(ctx context.Context, pred *store.SelectionPredicate) ([]*types.RoleBinding, error)

ListRoleBindings ...

func (*MockStore) ListRoles

func (s *MockStore) ListRoles(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Role, error)

ListRoles ...

func (*MockStore) NewInitializer

func (store *MockStore) NewInitializer() (store.Initializer, error)

NewInitializer ...

func (*MockStore) RegisterExtension

func (s *MockStore) RegisterExtension(ctx context.Context, ext *types.Extension) error

func (*MockStore) RevokeTokens

func (s *MockStore) RevokeTokens(claims ...*v2.Claims) error

RevokeTokens ...

func (*MockStore) UpdateAsset

func (s *MockStore) UpdateAsset(ctx context.Context, asset *types.Asset) error

UpdateAsset ...

func (*MockStore) UpdateCheckConfig

func (s *MockStore) UpdateCheckConfig(ctx context.Context, check *types.CheckConfig) error

UpdateCheckConfig ...

func (*MockStore) UpdateClusterRole

func (s *MockStore) UpdateClusterRole(ctx context.Context, clusterRole *types.ClusterRole) error

UpdateClusterRole ...

func (*MockStore) UpdateClusterRoleBinding

func (s *MockStore) UpdateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error

UpdateClusterRoleBinding ...

func (*MockStore) UpdateEntity

func (s *MockStore) UpdateEntity(ctx context.Context, e *types.Entity) error

UpdateEntity ...

func (*MockStore) UpdateEvent

func (s *MockStore) UpdateEvent(ctx context.Context, event *corev2.Event) (*corev2.Event, *corev2.Event, error)

UpdateEvent ...

func (*MockStore) UpdateEventFilter

func (s *MockStore) UpdateEventFilter(ctx context.Context, filter *types.EventFilter) error

UpdateEventFilter ...

func (*MockStore) UpdateFailingKeepalive

func (s *MockStore) UpdateFailingKeepalive(ctx context.Context, entity *types.Entity, expiration int64) error

UpdateFailingKeepalive ...

func (*MockStore) UpdateHandler

func (s *MockStore) UpdateHandler(ctx context.Context, handler *types.Handler) error

UpdateHandler ...

func (*MockStore) UpdateHookConfig

func (s *MockStore) UpdateHookConfig(ctx context.Context, hook *types.HookConfig) error

UpdateHookConfig ...

func (*MockStore) UpdateJWTSecret

func (s *MockStore) UpdateJWTSecret(secret []byte) error

UpdateJWTSecret ...

func (*MockStore) UpdateMutator

func (s *MockStore) UpdateMutator(ctx context.Context, mutator *types.Mutator) error

UpdateMutator ...

func (*MockStore) UpdateNamespace

func (s *MockStore) UpdateNamespace(ctx context.Context, org *types.Namespace) error

UpdateNamespace ...

func (*MockStore) UpdateRole

func (s *MockStore) UpdateRole(ctx context.Context, role *types.Role) error

UpdateRole ...

func (*MockStore) UpdateRoleBinding

func (s *MockStore) UpdateRoleBinding(ctx context.Context, roleBinding *types.RoleBinding) error

UpdateRoleBinding ...

func (*MockStore) UpdateSilencedEntry

func (s *MockStore) UpdateSilencedEntry(ctx context.Context, silenced *types.Silenced) error

UpdateSilencedEntry ...

func (*MockStore) UpdateUser

func (s *MockStore) UpdateUser(user *types.User) error

UpdateUser ...

type Ring

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

Ring ...

func (*Ring) Add

func (r *Ring) Add(ctx context.Context, value string) error

Add ...

func (*Ring) Next

func (r *Ring) Next(context.Context) (string, error)

Next ...

func (*Ring) Peek

func (r *Ring) Peek(context.Context) (string, error)

Peek ...

func (*Ring) Remove

func (r *Ring) Remove(ctx context.Context, value string) error

Remove ...

func (*Ring) SetError

func (r *Ring) SetError(err error)

SetError will cause Ring's methods to return err.

type StoreInitializer

type StoreInitializer struct {
	Initialized bool
	Err         error
}

StoreInitializer ...

func (*StoreInitializer) Close

func (s *StoreInitializer) Close() error

Close ...

func (*StoreInitializer) FlagAsInitialized

func (s *StoreInitializer) FlagAsInitialized() error

FlagAsInitialized ...

func (*StoreInitializer) IsInitialized

func (s *StoreInitializer) IsInitialized() (bool, error)

IsInitialized ...

func (*StoreInitializer) Lock

func (s *StoreInitializer) Lock() error

Lock ...

Jump to

Keyboard shortcuts

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