Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeContinueToken(ctx context.Context, r corev2.Resource) string
- func Count(ctx context.Context, client *clientv3.Client, key string) (int64, error)
- func Create(ctx context.Context, client *clientv3.Client, key, namespace string, ...) error
- func CreateOrUpdate(ctx context.Context, client *clientv3.Client, key, namespace string, ...) error
- func Delete(ctx context.Context, client *clientv3.Client, key string) error
- func Get(ctx context.Context, client *clientv3.Client, key string, object interface{}) error
- func GetAssetsPath(ctx context.Context, name string) string
- func GetCheckConfigsPath(ctx context.Context, name string) string
- func GetClusterRoleBindingsPath(ctx context.Context, name string) string
- func GetClusterRolesPath(ctx context.Context, name string) string
- func GetEntitiesPath(ctx context.Context, name string) string
- func GetEventFiltersPath(ctx context.Context, name string) string
- func GetEventsPath(ctx context.Context, entity string) string
- func GetHandlersPath(ctx context.Context, name string) string
- func GetHookConfigsPath(ctx context.Context, name string) string
- func GetMutatorsPath(ctx context.Context, name string) string
- func GetNamespacesPath(ctx context.Context, name string) string
- func GetRoleBindingsPath(ctx context.Context, name string) string
- func GetRolesPath(ctx context.Context, name string) string
- func GetSilencedPath(ctx context.Context, name string) string
- func GetUsersPath(ctx context.Context, id string) string
- func GetWatcherAction(event *clientv3.Event) store.WatchActionType
- func List(ctx context.Context, client *clientv3.Client, keyBuilder KeyBuilderFn, ...) error
- func NewLogrusFormatter() capnslog.Formatter
- func Update(ctx context.Context, client *clientv3.Client, key, namespace string, ...) error
- type GenericObject
- func (*GenericObject) Descriptor() ([]byte, []int)
- func (this *GenericObject) Equal(that interface{}) bool
- func (this *GenericObject) GetObjectMeta() v2.ObjectMeta
- func (this *GenericObject) GetRevision() uint32
- func (m *GenericObject) Marshal() (dAtA []byte, err error)
- func (m *GenericObject) MarshalTo(dAtA []byte) (int, error)
- func (this *GenericObject) Proto() github_com_golang_protobuf_proto.Message
- func (*GenericObject) ProtoMessage()
- func (m *GenericObject) Reset()
- func (m *GenericObject) Size() (n int)
- func (m *GenericObject) String() string
- func (this *GenericObject) TestProto() github_com_golang_protobuf_proto.Message
- func (m *GenericObject) Unmarshal(dAtA []byte) error
- func (m *GenericObject) XXX_DiscardUnknown()
- func (m *GenericObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *GenericObject) XXX_Merge(src proto.Message)
- func (m *GenericObject) XXX_Size() int
- func (m *GenericObject) XXX_Unmarshal(b []byte) error
- type GenericObjectFace
- type KeyBuilderFn
- type Store
- func (s *Store) AllowTokens(tokens ...*jwt.Token) error
- func (s *Store) AuthenticateUser(ctx context.Context, username, password string) (*types.User, error)
- func (s *Store) CreateClusterID(ctx context.Context, id string) error
- func (s *Store) CreateClusterRole(ctx context.Context, clusterRole *types.ClusterRole) error
- func (s *Store) CreateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error
- func (s *Store) CreateJWTSecret(secret []byte) error
- func (s *Store) CreateNamespace(ctx context.Context, namespace *types.Namespace) error
- func (s *Store) CreateOrUpdateClusterRole(ctx context.Context, clusterRole *types.ClusterRole) error
- func (s *Store) CreateOrUpdateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error
- func (s *Store) CreateOrUpdateResource(ctx context.Context, resource corev2.Resource) error
- func (s *Store) CreateOrUpdateRole(ctx context.Context, role *types.Role) error
- func (s *Store) CreateOrUpdateRoleBinding(ctx context.Context, roleBinding *types.RoleBinding) error
- func (s *Store) CreateOrUpdateTessenConfig(ctx context.Context, config *v2.TessenConfig) error
- func (s *Store) CreateResource(ctx context.Context, resource corev2.Resource) error
- func (s *Store) CreateRole(ctx context.Context, role *types.Role) error
- func (s *Store) CreateRoleBinding(ctx context.Context, roleBinding *types.RoleBinding) error
- func (s *Store) CreateUser(u *types.User) error
- func (s *Store) DeleteAssetByName(ctx context.Context, name string) error
- func (s *Store) DeleteCheckConfigByName(ctx context.Context, name string) error
- func (s *Store) DeleteClusterRole(ctx context.Context, name string) error
- func (s *Store) DeleteClusterRoleBinding(ctx context.Context, name string) error
- func (s *Store) DeleteEntity(ctx context.Context, e *corev2.Entity) error
- func (s *Store) DeleteEntityByName(ctx context.Context, name string) error
- func (s *Store) DeleteEventByEntityCheck(ctx context.Context, entityName, checkName string) error
- func (s *Store) DeleteEventFilterByName(ctx context.Context, name string) error
- func (s *Store) DeleteFailingKeepalive(ctx context.Context, entity *types.Entity) error
- func (s *Store) DeleteHandlerByName(ctx context.Context, name string) error
- func (s *Store) DeleteHookConfigByName(ctx context.Context, name string) error
- func (s *Store) DeleteMutatorByName(ctx context.Context, name string) error
- func (s *Store) DeleteNamespace(ctx context.Context, name string) error
- func (s *Store) DeleteResource(ctx context.Context, resourcePrefix, name string) error
- func (s *Store) DeleteRole(ctx context.Context, name string) error
- func (s *Store) DeleteRoleBinding(ctx context.Context, name string) error
- func (s *Store) DeleteSilencedEntryByName(ctx context.Context, silencedNames ...string) error
- func (s *Store) DeleteUser(ctx context.Context, user *types.User) error
- func (s *Store) DeregisterExtension(ctx context.Context, name string) error
- func (s *Store) GetAllUsers(pred *store.SelectionPredicate) ([]*types.User, error)
- func (s *Store) GetAssetByName(ctx context.Context, name string) (*types.Asset, error)
- func (s *Store) GetAssets(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Asset, error)
- func (s *Store) GetCheckConfigByName(ctx context.Context, name string) (*types.CheckConfig, error)
- func (s *Store) GetCheckConfigWatcher(ctx context.Context) <-chan store.WatchEventCheckConfig
- func (s *Store) GetCheckConfigs(ctx context.Context, pred *store.SelectionPredicate) ([]*types.CheckConfig, error)
- func (s *Store) GetClusterHealth(ctx context.Context, cluster clientv3.Cluster, etcdClientTLSConfig *tls.Config) *types.HealthResponse
- func (s *Store) GetClusterID(ctx context.Context) (string, error)
- func (s *Store) GetClusterRole(ctx context.Context, name string) (*types.ClusterRole, error)
- func (s *Store) GetClusterRoleBinding(ctx context.Context, name string) (*types.ClusterRoleBinding, error)
- func (s *Store) GetEntities(ctx context.Context, pred *store.SelectionPredicate) ([]*corev2.Entity, error)
- func (s *Store) GetEntityByName(ctx context.Context, name string) (*corev2.Entity, error)
- func (s *Store) GetEntityWatcher(ctx context.Context) <-chan store.WatchEventEntity
- func (s *Store) GetEventByEntityCheck(ctx context.Context, entityName, checkName string) (*corev2.Event, error)
- func (s *Store) GetEventFilterByName(ctx context.Context, name string) (*types.EventFilter, error)
- func (s *Store) GetEventFilters(ctx context.Context, pred *store.SelectionPredicate) ([]*types.EventFilter, error)
- func (s *Store) GetEvents(ctx context.Context, pred *store.SelectionPredicate) ([]*corev2.Event, error)
- func (s *Store) GetEventsByEntity(ctx context.Context, entityName string, pred *store.SelectionPredicate) ([]*corev2.Event, error)
- func (s *Store) GetExtension(ctx context.Context, name string) (*types.Extension, error)
- func (s *Store) GetExtensions(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Extension, error)
- func (s *Store) GetFailingKeepalives(ctx context.Context) ([]*types.KeepaliveRecord, error)
- func (s *Store) GetHandlerByName(ctx context.Context, name string) (*types.Handler, error)
- func (s *Store) GetHandlers(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Handler, error)
- func (s *Store) GetHookConfigByName(ctx context.Context, name string) (*types.HookConfig, error)
- func (s *Store) GetHookConfigs(ctx context.Context, pred *store.SelectionPredicate) ([]*types.HookConfig, error)
- func (s *Store) GetJWTSecret() ([]byte, error)
- func (s *Store) GetMutatorByName(ctx context.Context, name string) (*types.Mutator, error)
- func (s *Store) GetMutators(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Mutator, error)
- func (s *Store) GetNamespace(ctx context.Context, name string) (*types.Namespace, error)
- func (s *Store) GetResource(ctx context.Context, name string, resource corev2.Resource) error
- func (s *Store) GetRole(ctx context.Context, name string) (*types.Role, error)
- func (s *Store) GetRoleBinding(ctx context.Context, name string) (*types.RoleBinding, error)
- func (s *Store) GetSilencedEntries(ctx context.Context) ([]*corev2.Silenced, error)
- func (s *Store) GetSilencedEntriesByCheckName(ctx context.Context, checkName string) ([]*corev2.Silenced, error)
- func (s *Store) GetSilencedEntriesByName(ctx context.Context, names ...string) ([]*corev2.Silenced, error)
- func (s *Store) GetSilencedEntriesBySubscription(ctx context.Context, subscriptions ...string) ([]*corev2.Silenced, error)
- func (s *Store) GetSilencedEntryByName(ctx context.Context, name string) (*corev2.Silenced, error)
- func (s *Store) GetTessenConfig(ctx context.Context) (*v2.TessenConfig, error)
- func (s *Store) GetTessenConfigWatcher(ctx context.Context) <-chan store.WatchEventTessenConfig
- func (s *Store) GetToken(subject, id string) (*types.Claims, error)
- func (s *Store) GetUser(ctx context.Context, username string) (*types.User, error)
- func (s *Store) GetUsers() ([]*types.User, error)
- func (s *Store) ListClusterRoleBindings(ctx context.Context, pred *store.SelectionPredicate) ([]*types.ClusterRoleBinding, error)
- func (s *Store) ListClusterRoles(ctx context.Context, pred *store.SelectionPredicate) ([]*types.ClusterRole, error)
- func (s *Store) ListNamespaces(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Namespace, error)
- func (s *Store) ListResources(ctx context.Context, resourcePrefix string, resources interface{}, ...) error
- func (s *Store) ListRoleBindings(ctx context.Context, pred *store.SelectionPredicate) ([]*types.RoleBinding, error)
- func (s *Store) ListRoles(ctx context.Context, pred *store.SelectionPredicate) ([]*types.Role, error)
- func (store *Store) NewInitializer() (store.Initializer, error)
- func (s *Store) RegisterExtension(ctx context.Context, ext *types.Extension) error
- func (s *Store) RevokeTokens(claims ...*v2.Claims) error
- func (s *Store) UpdateAsset(ctx context.Context, asset *types.Asset) error
- func (s *Store) UpdateCheckConfig(ctx context.Context, check *types.CheckConfig) error
- func (s *Store) UpdateClusterRole(ctx context.Context, clusterRole *types.ClusterRole) error
- func (s *Store) UpdateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error
- func (s *Store) UpdateEntity(ctx context.Context, e *corev2.Entity) error
- func (s *Store) UpdateEvent(ctx context.Context, event *corev2.Event) (*corev2.Event, *corev2.Event, error)
- func (s *Store) UpdateEventFilter(ctx context.Context, filter *types.EventFilter) error
- func (s *Store) UpdateFailingKeepalive(ctx context.Context, entity *types.Entity, expiration int64) error
- func (s *Store) UpdateHandler(ctx context.Context, handler *types.Handler) error
- func (s *Store) UpdateHookConfig(ctx context.Context, hook *types.HookConfig) error
- func (s *Store) UpdateJWTSecret(secret []byte) error
- func (s *Store) UpdateMutator(ctx context.Context, mutator *types.Mutator) error
- func (s *Store) UpdateNamespace(ctx context.Context, namespace *types.Namespace) error
- func (s *Store) UpdateRole(ctx context.Context, role *types.Role) error
- func (s *Store) UpdateRoleBinding(ctx context.Context, roleBinding *types.RoleBinding) error
- func (s *Store) UpdateSilencedEntry(ctx context.Context, silenced *corev2.Silenced) error
- func (s *Store) UpdateUser(u *types.User) error
- type StoreInitializer
- type Watcher
Constants ¶
const (
// EtcdRoot is the root of all sensu storage.
EtcdRoot = "/sensu.io"
)
Variables ¶
var ( ErrInvalidLengthGenericObject = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenericObject = fmt.Errorf("proto: integer overflow") )
Functions ¶
func ComputeContinueToken ¶
ComputeContinueToken calculates a continue token based on the given resource
func Count ¶
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 GetAssetsPath ¶
GetAssetsPath gets the path of the asset store.
func GetCheckConfigsPath ¶
GetCheckConfigsPath gets the path of the check config store.
func GetClusterRoleBindingsPath ¶
GetClusterRoleBindingsPath gets the path of the cluster role binding store.
func GetClusterRolesPath ¶
GetClusterRolesPath gets the path of the cluster role store.
func GetEntitiesPath ¶
GetEntitiesPath gets the path of the entity store
func GetEventFiltersPath ¶
GetEventFiltersPath gets the path of the event filter store.
func GetEventsPath ¶
GetEventsPath gets the path of the event store.
func GetHandlersPath ¶
GetHandlersPath gets the path of the handler store.
func GetHookConfigsPath ¶
GetHookConfigsPath gets the path of the hook config store.
func GetMutatorsPath ¶
GetMutatorsPath gets the path of the mutator store.
func GetNamespacesPath ¶
GetNamespacesPath gets the path of the namespace store.
func GetRoleBindingsPath ¶
GetRoleBindingsPath gets the path of the role binding store.
func GetRolesPath ¶
GetRolesPath gets the path of the role store.
func GetSilencedPath ¶
GetSilencedPath gets the path of the silenced store.
func GetUsersPath ¶
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 ¶
NewLogrusFormatter creates a new LogrusFormatter
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) Proto ¶
func (this *GenericObject) Proto() github_com_golang_protobuf_proto.Message
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 (this *GenericObject) TestProto() github_com_golang_protobuf_proto.Message
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 ¶
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 (*Store) AllowTokens ¶
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 ¶
CreateClusterID creates a sensu cluster id
func (*Store) CreateClusterRole ¶
CreateClusterRole ...
func (*Store) CreateClusterRoleBinding ¶
func (s *Store) CreateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error
CreateClusterRoleBinding ...
func (*Store) CreateJWTSecret ¶
CreateJWTSecret creates a new JWT secret
func (*Store) CreateNamespace ¶
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 ¶
CreateOrUpdateResource creates or updates the given resource regardless of whether it already exists or not
func (*Store) CreateOrUpdateRole ¶
CreateOrUpdateRole ...
func (*Store) CreateOrUpdateRoleBinding ¶
func (s *Store) CreateOrUpdateRoleBinding(ctx context.Context, roleBinding *types.RoleBinding) error
CreateOrUpdateRoleBinding ...
func (*Store) CreateOrUpdateTessenConfig ¶
CreateOrUpdateTessenConfig creates or updates the tessen configuration
func (*Store) CreateResource ¶
CreateResource creates the given resource only if it does not already exist
func (*Store) CreateRole ¶
CreateRole ...
func (*Store) CreateRoleBinding ¶
CreateRoleBinding ...
func (*Store) CreateUser ¶
CreateUser creates a new user
func (*Store) DeleteAssetByName ¶
DeleteAssetByName deletes an asset by name.
func (*Store) DeleteCheckConfigByName ¶
DeleteCheckConfigByName deletes a CheckConfig by name.
func (*Store) DeleteClusterRole ¶
DeleteClusterRole ...
func (*Store) DeleteClusterRoleBinding ¶
DeleteClusterRoleBinding ...
func (*Store) DeleteEntity ¶
DeleteEntity deletes an Entity.
func (*Store) DeleteEntityByName ¶
DeleteEntityByName deletes an Entity by its name.
func (*Store) DeleteEventByEntityCheck ¶
DeleteEventByEntityCheck deletes an event by entity name and check name.
func (*Store) DeleteEventFilterByName ¶
DeleteEventFilterByName deletes an EventFilter by name.
func (*Store) DeleteFailingKeepalive ¶
DeleteFailingKeepalive deletes a failing KeepaliveRecord.
func (*Store) DeleteHandlerByName ¶
DeleteHandlerByName deletes a Handler by name.
func (*Store) DeleteHookConfigByName ¶
DeleteHookConfigByName deletes a HookConfig by name.
func (*Store) DeleteMutatorByName ¶
DeleteMutatorByName deletes a Mutator by name.
func (*Store) DeleteNamespace ¶
DeleteNamespace deletes the namespace with the given name
func (*Store) DeleteResource ¶
DeleteResource deletes the resource using the given resource prefix and name
func (*Store) DeleteRole ¶
DeleteRole ...
func (*Store) DeleteRoleBinding ¶
DeleteRoleBinding ...
func (*Store) DeleteSilencedEntryByName ¶
DeleteSilencedEntryByName deletes one or more silenced entries by name
func (*Store) DeleteUser ¶
DeleteUser deletes a User. NOTE: Store probably shouldn't be responsible for deleting the token; business logic.
func (*Store) DeregisterExtension ¶
DeregisterExtension deregisters an extension
func (*Store) GetAllUsers ¶
GetAllUsers retrieves all users
func (*Store) GetAssetByName ¶
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 ¶
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 ¶
GetClusterID gets the sensu cluster id
func (*Store) GetClusterRole ¶
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 ¶
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 ¶
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 ¶
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 ¶
GetFailingKeepalives gets all of the failing KeepaliveRecords.
func (*Store) GetHandlerByName ¶
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 ¶
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 ¶
GetJWTSecret retrieves the JWT signing secret
func (*Store) GetMutatorByName ¶
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 ¶
GetNamespace returns a single namespace with the given name
func (*Store) GetResource ¶
GetResource retrieves a resource with the given name and stores it into the resource pointer
func (*Store) GetRoleBinding ¶
GetRoleBinding ...
func (*Store) GetSilencedEntries ¶
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 ¶
GetSilencedEntryByName gets a silenced entry by name.
func (*Store) GetTessenConfig ¶
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) 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 ¶
RegisterExtension registers an extension.
func (*Store) RevokeTokens ¶
RevokeTokens removes the provided tokens from the JWT access list
func (*Store) UpdateAsset ¶
UpdateAsset updates an asset.
func (*Store) UpdateCheckConfig ¶
UpdateCheckConfig updates a CheckConfig.
func (*Store) UpdateClusterRole ¶
UpdateClusterRole ...
func (*Store) UpdateClusterRoleBinding ¶
func (s *Store) UpdateClusterRoleBinding(ctx context.Context, clusterRoleBinding *types.ClusterRoleBinding) error
UpdateClusterRoleBinding ...
func (*Store) UpdateEntity ¶
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 ¶
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 ¶
UpdateHandler updates a Handler.
func (*Store) UpdateHookConfig ¶
UpdateHookConfig updates a HookConfig.
func (*Store) UpdateJWTSecret ¶
UpdateJWTSecret replaces the jwt secret with a new one.
func (*Store) UpdateMutator ¶
UpdateMutator updates a Mutator.
func (*Store) UpdateNamespace ¶
UpdateNamespace updates a namespace with the given object
func (*Store) UpdateRole ¶
UpdateRole ...
func (*Store) UpdateRoleBinding ¶
UpdateRoleBinding ...
func (*Store) UpdateSilencedEntry ¶
UpdateSilencedEntry updates a Silenced.
type StoreInitializer ¶
type StoreInitializer struct {
// contains filtered or unexported fields
}
StoreInitializer ...
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
Source Files ¶
- asset_store.go
- authentication.go
- check_store.go
- cluster_id_store.go
- clusterrole_store.go
- clusterrolebinding_store.go
- compare.go
- entity_store.go
- event_store.go
- extension_registry.go
- filter_store.go
- generic_object.pb.go
- handler_store.go
- health_store.go
- hook_store.go
- initialization.go
- keepalive_store.go
- logger.go
- logrus_formatter.go
- mutator_store.go
- namespace_store.go
- resource.go
- role_store.go
- rolebinding_store.go
- silenced_store.go
- store.go
- tessen_store.go
- token_store.go
- user_store.go
- watcher.go
- watchers.go