etcd

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, + 1 more Imports: 27 Imported by: 24

Documentation

Index

Constants

View Source
const (
	// EtcdRoot is the root of all sensu storage.
	EtcdRoot = "/sensu.io"
)

Variables

View Source
var (
	ErrInvalidLengthGenericObject = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenericObject   = fmt.Errorf("proto: integer overflow")
)

Functions

func ComputeContinueToken

func ComputeContinueToken(ctx context.Context, r corev2.Resource) string

ComputeContinueToken calculates a continue token based on the given resource

func Count

func Count(ctx context.Context, client *clientv3.Client, key string) (int64, error)

Count retrieves the count of all keys from storage under the provided prefix key, while supporting all namespaces.

func Create

func Create(ctx context.Context, client *clientv3.Client, key, namespace string, object proto.Message) error

Create the given key with the serialized object.

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, client *clientv3.Client, key, namespace string, object interface{}) error

CreateOrUpdate writes the given key with the serialized object, regarless of its current existence

func Delete

func Delete(ctx context.Context, client *clientv3.Client, key string) error

Delete the given key

func Get

func Get(ctx context.Context, client *clientv3.Client, key string, object interface{}) error

Get retrieves an object with the given key

func GetAssetsPath

func GetAssetsPath(ctx context.Context, name string) string

GetAssetsPath gets the path of the asset store.

func GetCheckConfigsPath

func GetCheckConfigsPath(ctx context.Context, name string) string

GetCheckConfigsPath gets the path of the check config store.

func GetClusterRoleBindingsPath

func GetClusterRoleBindingsPath(ctx context.Context, name string) string

GetClusterRoleBindingsPath gets the path of the cluster role binding store.

func GetClusterRolesPath

func GetClusterRolesPath(ctx context.Context, name string) string

GetClusterRolesPath gets the path of the cluster role store.

func GetEntitiesPath

func GetEntitiesPath(ctx context.Context, name string) string

GetEntitiesPath gets the path of the entity store

func GetEventFiltersPath

func GetEventFiltersPath(ctx context.Context, name string) string

GetEventFiltersPath gets the path of the event filter store.

func GetEventsPath

func GetEventsPath(ctx context.Context, entity string) string

GetEventsPath gets the path of the event store.

func GetHandlersPath

func GetHandlersPath(ctx context.Context, name string) string

GetHandlersPath gets the path of the handler store.

func GetHookConfigsPath

func GetHookConfigsPath(ctx context.Context, name string) string

GetHookConfigsPath gets the path of the hook config store.

func GetMutatorsPath

func GetMutatorsPath(ctx context.Context, name string) string

GetMutatorsPath gets the path of the mutator store.

func GetNamespacesPath

func GetNamespacesPath(ctx context.Context, name string) string

GetNamespacesPath gets the path of the namespace store.

func GetRoleBindingsPath

func GetRoleBindingsPath(ctx context.Context, name string) string

GetRoleBindingsPath gets the path of the role binding store.

func GetRolesPath

func GetRolesPath(ctx context.Context, name string) string

GetRolesPath gets the path of the role store.

func GetSilencedPath

func GetSilencedPath(ctx context.Context, name string) string

GetSilencedPath gets the path of the silenced store.

func GetUsersPath

func GetUsersPath(ctx context.Context, id string) string

GetUsersPath gets the path of the user store.

func GetWatcherAction

func GetWatcherAction(event *clientv3.Event) store.WatchActionType

GetWatcherAction maps an etcd Event to the corresponding WatchActionType. This function is exported for use by sensu-enterprise-go's etcd watchers.

func List

func List(ctx context.Context, client *clientv3.Client, keyBuilder KeyBuilderFn, objsPtr interface{}, pred *store.SelectionPredicate) error

List retrieves all keys from storage under the provided prefix key, while supporting all namespaces, and deserialize it into objsPtr.

func NewLogrusFormatter

func NewLogrusFormatter() capnslog.Formatter

NewLogrusFormatter creates a new LogrusFormatter

func Update

func Update(ctx context.Context, client *clientv3.Client, key, namespace string, object proto.Message) error

Update a key given with the serialized object.

Types

type GenericObject

type GenericObject struct {
	// URL is the location of the asset
	Revision uint32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision"`
	// Metadata contains the name, namespace, labels and annotations of the asset
	v2.ObjectMeta        `protobuf:"bytes,2,opt,name=metadata,embedded=metadata" json:"metadata,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Asset defines an asset agents install as a dependency for a check.

func NewGenericObjectFromFace

func NewGenericObjectFromFace(that GenericObjectFace) *GenericObject

func NewPopulatedGenericObject

func NewPopulatedGenericObject(r randyGenericObject, easy bool) *GenericObject

func (*GenericObject) Descriptor

func (*GenericObject) Descriptor() ([]byte, []int)

func (*GenericObject) Equal

func (this *GenericObject) Equal(that interface{}) bool

func (*GenericObject) GetObjectMeta

func (this *GenericObject) GetObjectMeta() v2.ObjectMeta

func (*GenericObject) GetRevision

func (this *GenericObject) GetRevision() uint32

func (*GenericObject) Marshal

func (m *GenericObject) Marshal() (dAtA []byte, err error)

func (*GenericObject) MarshalTo

func (m *GenericObject) MarshalTo(dAtA []byte) (int, error)

func (*GenericObject) Proto

func (*GenericObject) ProtoMessage

func (*GenericObject) ProtoMessage()

func (*GenericObject) Reset

func (m *GenericObject) Reset()

func (*GenericObject) Size

func (m *GenericObject) Size() (n int)

func (*GenericObject) String

func (m *GenericObject) String() string

func (*GenericObject) TestProto

func (*GenericObject) Unmarshal

func (m *GenericObject) Unmarshal(dAtA []byte) error

func (*GenericObject) XXX_DiscardUnknown

func (m *GenericObject) XXX_DiscardUnknown()

func (*GenericObject) XXX_Marshal

func (m *GenericObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenericObject) XXX_Merge

func (dst *GenericObject) XXX_Merge(src proto.Message)

func (*GenericObject) XXX_Size

func (m *GenericObject) XXX_Size() int

func (*GenericObject) XXX_Unmarshal

func (m *GenericObject) XXX_Unmarshal(b []byte) error

type GenericObjectFace

type GenericObjectFace interface {
	Proto() github_com_golang_protobuf_proto.Message
	GetRevision() uint32
	GetObjectMeta() v2.ObjectMeta
}

type KeyBuilderFn

type KeyBuilderFn func(context.Context, string) string

KeyBuilderFn represents a generic key builder function

type Store

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

Store is an implementation of the sensu-go/backend/store.Store iface.

func NewStore

func NewStore(client *clientv3.Client, name string) *Store

NewStore creates a new Store.

func (*Store) AllowTokens

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

AllowTokens adds the provided tokens to the JWT access list

func (*Store) AuthenticateUser

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

AuthenticateUser authenticates a User by username and password.

func (*Store) CreateClusterID

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

CreateClusterID creates a sensu cluster id

func (*Store) CreateClusterRole

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

CreateClusterRole ...

func (*Store) CreateClusterRoleBinding

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

CreateClusterRoleBinding ...

func (*Store) CreateJWTSecret

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

CreateJWTSecret creates a new JWT secret

func (*Store) CreateNamespace

func (s *Store) CreateNamespace(ctx context.Context, namespace *types.Namespace) error

CreateNamespace creates a namespace with the provided namespace

func (*Store) CreateOrUpdateClusterRole

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

CreateOrUpdateClusterRole ...

func (*Store) CreateOrUpdateClusterRoleBinding

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

CreateOrUpdateClusterRoleBinding ...

func (*Store) CreateOrUpdateResource

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

CreateOrUpdateResource creates or updates the given resource regardless of whether it already exists or not

func (*Store) CreateOrUpdateRole

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

CreateOrUpdateRole ...

func (*Store) CreateOrUpdateRoleBinding

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

CreateOrUpdateRoleBinding ...

func (*Store) CreateOrUpdateTessenConfig

func (s *Store) CreateOrUpdateTessenConfig(ctx context.Context, config *v2.TessenConfig) error

CreateOrUpdateTessenConfig creates or updates the tessen configuration

func (*Store) CreateResource

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

CreateResource creates the given resource only if it does not already exist

func (*Store) CreateRole

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

CreateRole ...

func (*Store) CreateRoleBinding

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

CreateRoleBinding ...

func (*Store) CreateUser

func (s *Store) CreateUser(u *types.User) error

CreateUser creates a new user

func (*Store) DeleteAssetByName

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

DeleteAssetByName deletes an asset by name.

func (*Store) DeleteCheckConfigByName

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

DeleteCheckConfigByName deletes a CheckConfig by name.

func (*Store) DeleteClusterRole

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

DeleteClusterRole ...

func (*Store) DeleteClusterRoleBinding

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

DeleteClusterRoleBinding ...

func (*Store) DeleteEntity

func (s *Store) DeleteEntity(ctx context.Context, e *corev2.Entity) error

DeleteEntity deletes an Entity.

func (*Store) DeleteEntityByName

func (s *Store) DeleteEntityByName(ctx context.Context, name string) error

DeleteEntityByName deletes an Entity by its name.

func (*Store) DeleteEventByEntityCheck

func (s *Store) DeleteEventByEntityCheck(ctx context.Context, entityName, checkName string) error

DeleteEventByEntityCheck deletes an event by entity name and check name.

func (*Store) DeleteEventFilterByName

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

DeleteEventFilterByName deletes an EventFilter by name.

func (*Store) DeleteFailingKeepalive

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

DeleteFailingKeepalive deletes a failing KeepaliveRecord.

func (*Store) DeleteHandlerByName

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

DeleteHandlerByName deletes a Handler by name.

func (*Store) DeleteHookConfigByName

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

DeleteHookConfigByName deletes a HookConfig by name.

func (*Store) DeleteMutatorByName

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

DeleteMutatorByName deletes a Mutator by name.

func (*Store) DeleteNamespace

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

DeleteNamespace deletes the namespace with the given name

func (*Store) DeleteResource

func (s *Store) DeleteResource(ctx context.Context, resourcePrefix, name string) error

DeleteResource deletes the resource using the given resource prefix and name

func (*Store) DeleteRole

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

DeleteRole ...

func (*Store) DeleteRoleBinding

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

DeleteRoleBinding ...

func (*Store) DeleteSilencedEntryByName

func (s *Store) DeleteSilencedEntryByName(ctx context.Context, silencedNames ...string) error

DeleteSilencedEntryByName deletes one or more silenced entries by name

func (*Store) DeleteUser

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

DeleteUser deletes a User. NOTE: Store probably shouldn't be responsible for deleting the token; business logic.

func (*Store) DeregisterExtension

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

DeregisterExtension deregisters an extension

func (*Store) GetAllUsers

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

GetAllUsers retrieves all users

func (*Store) GetAssetByName

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

GetAssetByName gets an Asset by name.

func (*Store) GetAssets

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

GetAssets fetches all assets from the store

func (*Store) GetCheckConfigByName

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

GetCheckConfigByName gets a CheckConfig by name.

func (*Store) GetCheckConfigWatcher

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

GetCheckConfigWatcher returns a channel that emits WatchEventCheckConfig structs notifying the caller that a CheckConfig was updated. If the watcher runs into a terminal error or the context passed is cancelled, then the channel will be closed. The watcher will do its best to recover on errors.

func (*Store) GetCheckConfigs

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

GetCheckConfigs returns check configurations for an (optional) namespace.

func (*Store) GetClusterHealth

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

GetClusterHealth retrieves the cluster health

func (*Store) GetClusterID

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

GetClusterID gets the sensu cluster id

func (*Store) GetClusterRole

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

GetClusterRole ...

func (*Store) GetClusterRoleBinding

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

GetClusterRoleBinding ...

func (*Store) GetEntities

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

GetEntities returns the entities for the namespace in the supplied context.

func (*Store) GetEntityByName

func (s *Store) GetEntityByName(ctx context.Context, name string) (*corev2.Entity, error)

GetEntityByName gets an Entity by its name.

func (*Store) GetEntityWatcher

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

GetEntityWatcher returns a channel that emits WatchEventEntity structs notifying the caller that an Entity was updated. If the watcher runs into a terminal error or the context passed is cancelled, then the channel will be closed. The watcher does its best to recover from errors.

func (*Store) GetEventByEntityCheck

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

GetEventByEntityCheck gets an event by entity and check name.

func (*Store) GetEventFilterByName

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

GetEventFilterByName gets an EventFilter by name.

func (*Store) GetEventFilters

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

GetEventFilters gets the list of filters for a namespace.

func (*Store) GetEvents

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

GetEvents returns the events for an (optional) namespace. If namespace is the empty string, GetEvents returns all events for all namespaces.

func (*Store) GetEventsByEntity

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

GetEventsByEntity gets all events matching a given entity name.

func (*Store) GetExtension

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

GetExtension gets an extension

func (*Store) GetExtensions

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

GetExtensions gets an extension

func (*Store) GetFailingKeepalives

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

GetFailingKeepalives gets all of the failing KeepaliveRecords.

func (*Store) GetHandlerByName

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

GetHandlerByName gets a Handler by name.

func (*Store) GetHandlers

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

GetHandlers gets the list of handlers for a namespace.

func (*Store) GetHookConfigByName

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

GetHookConfigByName gets a HookConfig by name.

func (*Store) GetHookConfigs

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

GetHookConfigs returns hook configurations for a namespace.

func (*Store) GetJWTSecret

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

GetJWTSecret retrieves the JWT signing secret

func (*Store) GetMutatorByName

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

GetMutatorByName gets a Mutator by name.

func (*Store) GetMutators

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

GetMutators gets the list of mutators for a namespace.

func (*Store) GetNamespace

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

GetNamespace returns a single namespace with the given name

func (*Store) GetResource

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

GetResource retrieves a resource with the given name and stores it into the resource pointer

func (*Store) GetRole

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

GetRole ...

func (*Store) GetRoleBinding

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

GetRoleBinding ...

func (*Store) GetSilencedEntries

func (s *Store) GetSilencedEntries(ctx context.Context) ([]*corev2.Silenced, error)

GetSilencedEntries gets all silenced entries.

func (*Store) GetSilencedEntriesByCheckName

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

GetSilencedEntriesByCheckName gets all silenced entries that match a check name.

func (*Store) GetSilencedEntriesByName

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

GetSilencedEntriesByName gets the named silenced entries.

func (*Store) GetSilencedEntriesBySubscription

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

GetSilencedEntriesBySubscription gets all silenced entries that match a set of subscriptions.

func (*Store) GetSilencedEntryByName

func (s *Store) GetSilencedEntryByName(ctx context.Context, name string) (*corev2.Silenced, error)

GetSilencedEntryByName gets a silenced entry by name.

func (*Store) GetTessenConfig

func (s *Store) GetTessenConfig(ctx context.Context) (*v2.TessenConfig, error)

GetTessenConfig gets the tessen configuration

func (*Store) GetTessenConfigWatcher

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

GetTessenConfigWatcher returns a channel that emits WatchEventTessenConfig structs notifying the caller that a TessenConfig was updated. If the watcher runs into a terminal error or the context passed is cancelled, then the channel will be closed. The caller must The watcher does its best to recover from errors.

func (*Store) GetToken

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

GetToken gets a Claims.

func (*Store) GetUser

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

GetUser gets a User.

func (*Store) GetUsers

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

GetUsers retrieves all enabled users

func (*Store) ListClusterRoleBindings

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

ListClusterRoleBindings ...

func (*Store) ListClusterRoles

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

ListClusterRoles ...

func (*Store) ListNamespaces

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

ListNamespaces returns all namespaces

func (*Store) ListResources

func (s *Store) ListResources(ctx context.Context, resourcePrefix string, resources interface{}, pred *store.SelectionPredicate) error

ListResources retrieves all resources for the resourcePrefix type and stores them into the resources pointer

func (*Store) ListRoleBindings

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

ListRoleBindings ...

func (*Store) ListRoles

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

ListRoles ...

func (*Store) NewInitializer

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

NewInitializer returns a new store initializer

func (*Store) RegisterExtension

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

RegisterExtension registers an extension.

func (*Store) RevokeTokens

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

RevokeTokens removes the provided tokens from the JWT access list

func (*Store) UpdateAsset

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

UpdateAsset updates an asset.

func (*Store) UpdateCheckConfig

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

UpdateCheckConfig updates a CheckConfig.

func (*Store) UpdateClusterRole

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

UpdateClusterRole ...

func (*Store) UpdateClusterRoleBinding

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

UpdateClusterRoleBinding ...

func (*Store) UpdateEntity

func (s *Store) UpdateEntity(ctx context.Context, e *corev2.Entity) error

UpdateEntity updates an Entity.

func (*Store) UpdateEvent

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

UpdateEvent updates an event.

func (*Store) UpdateEventFilter

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

UpdateEventFilter updates an EventFilter.

func (*Store) UpdateFailingKeepalive

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

UpdateFailingKeepalive updates a failing KeepaliveRecord.

func (*Store) UpdateHandler

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

UpdateHandler updates a Handler.

func (*Store) UpdateHookConfig

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

UpdateHookConfig updates a HookConfig.

func (*Store) UpdateJWTSecret

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

UpdateJWTSecret replaces the jwt secret with a new one.

func (*Store) UpdateMutator

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

UpdateMutator updates a Mutator.

func (*Store) UpdateNamespace

func (s *Store) UpdateNamespace(ctx context.Context, namespace *types.Namespace) error

UpdateNamespace updates a namespace with the given object

func (*Store) UpdateRole

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

UpdateRole ...

func (*Store) UpdateRoleBinding

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

UpdateRoleBinding ...

func (*Store) UpdateSilencedEntry

func (s *Store) UpdateSilencedEntry(ctx context.Context, silenced *corev2.Silenced) error

UpdateSilencedEntry updates a Silenced.

func (*Store) UpdateUser

func (s *Store) UpdateUser(u *types.User) error

UpdateUser updates a User.

type StoreInitializer

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

StoreInitializer ...

func (*StoreInitializer) Close

func (s *StoreInitializer) Close() error

Close session & unlock

func (*StoreInitializer) FlagAsInitialized

func (s *StoreInitializer) FlagAsInitialized() error

FlagAsInitialized - set .initialized key

func (*StoreInitializer) IsInitialized

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

IsInitialized checks the state of the .initialized key

func (*StoreInitializer) Lock

func (s *StoreInitializer) Lock() error

Lock mutex to avoid competing writes

type Watcher

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

Watcher implements the store.Watcher interface rather than clientv3.Watcher, so the channel returned by the Watch method only provides a single event at a time instead of a list of events, and the events are ready to be consumed

func Watch

func Watch(ctx context.Context, client *clientv3.Client, key string, recursive bool, opts ...clientv3.OpOption) *Watcher

Watch returns a Watcher for the given key. If recursive is true, then the watcher is created with clientv3.WithPrefix. The watcher will also be provided with any etcd client options passed in.

func (*Watcher) Result

func (w *Watcher) Result() <-chan store.WatchEvent

Result returns the resultChan

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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