Documentation ¶
Index ¶
- type CheckController
- func (a CheckController) AddCheckHook(ctx context.Context, check string, checkHook corev2.HookList) error
- func (a CheckController) Find(ctx context.Context, name string) (*corev2.CheckConfig, error)
- func (a CheckController) QueueAdhocRequest(ctx context.Context, name string, adhocRequest *corev2.AdhocRequest) error
- func (a CheckController) RemoveCheckHook(ctx context.Context, checkName string, hookType string, hookName string) error
- type ClusterController
- func (c ClusterController) ClusterID(ctx context.Context) (string, error)
- func (c ClusterController) MemberAdd(ctx context.Context, addrs []string) (*clientv3.MemberAddResponse, error)
- func (c ClusterController) MemberList(ctx context.Context) (*clientv3.MemberListResponse, error)
- func (c ClusterController) MemberRemove(ctx context.Context, id uint64) (*clientv3.MemberRemoveResponse, error)
- func (c ClusterController) MemberUpdate(ctx context.Context, id uint64, addrs []string) (*clientv3.MemberUpdateResponse, error)
- type EntityDeleter
- type ErrCode
- type Error
- type EventController
- func (a EventController) Create(ctx context.Context, event *corev2.Event) error
- func (a EventController) CreateOrReplace(ctx context.Context, event *corev2.Event) error
- func (a EventController) Delete(ctx context.Context, entity, check string) error
- func (a EventController) Get(ctx context.Context, entity, check string) (*corev2.Event, error)
- func (a EventController) List(ctx context.Context, pred *store.SelectionPredicate) ([]corev2.Resource, error)
- type HealthController
- type QueryParams
- type SilencedController
- type TessenController
- type TessenMetricController
- type UserController
- func (a UserController) AddGroup(ctx context.Context, username string, group string) error
- func (a UserController) Create(ctx context.Context, user *corev2.User) error
- func (a UserController) CreateOrReplace(ctx context.Context, user *corev2.User) error
- func (a UserController) Disable(ctx context.Context, name string) error
- func (a UserController) Enable(ctx context.Context, name string) error
- func (a UserController) Get(ctx context.Context, name string) (*corev2.User, error)
- func (a UserController) List(ctx context.Context, pred *store.SelectionPredicate) ([]corev2.Resource, error)
- func (a UserController) RemoveAllGroups(ctx context.Context, username string) error
- func (a UserController) RemoveGroup(ctx context.Context, username string, group string) error
- type VersionController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckController ¶
type CheckController struct {
// contains filtered or unexported fields
}
CheckController exposes actions which a viewer can perform.
func NewCheckController ¶
func NewCheckController(store store.CheckConfigStore, getter types.QueueGetter) CheckController
NewCheckController returns new CheckController
func (CheckController) AddCheckHook ¶
func (a CheckController) AddCheckHook(ctx context.Context, check string, checkHook corev2.HookList) error
AddCheckHook adds an association between a hook and a check
func (CheckController) Find ¶
func (a CheckController) Find(ctx context.Context, name string) (*corev2.CheckConfig, error)
Find returns resource associated with given parameters if available to the viewer.
func (CheckController) QueueAdhocRequest ¶
func (a CheckController) QueueAdhocRequest(ctx context.Context, name string, adhocRequest *corev2.AdhocRequest) error
QueueAdhocRequest takes a check request and adds it to the queue for processing.
func (CheckController) RemoveCheckHook ¶
func (a CheckController) RemoveCheckHook(ctx context.Context, checkName string, hookType string, hookName string) error
RemoveCheckHook removes an association between a hook and a check
type ClusterController ¶
type ClusterController struct {
// contains filtered or unexported fields
}
ClusterController is a thin wrapper around clientv3.Cluster. It exists only for the purposes of access control.
func NewClusterController ¶
func NewClusterController(cluster clientv3.Cluster, store store.ClusterIDStore) ClusterController
NewClusterController provides a new controller for the etcd cluster.
func (ClusterController) ClusterID ¶
func (c ClusterController) ClusterID(ctx context.Context) (string, error)
ClusterID gets the sensu cluster id.
func (ClusterController) MemberAdd ¶
func (c ClusterController) MemberAdd(ctx context.Context, addrs []string) (*clientv3.MemberAddResponse, error)
MemberAdd adds a member to the cluster.
func (ClusterController) MemberList ¶
func (c ClusterController) MemberList(ctx context.Context) (*clientv3.MemberListResponse, error)
MemberList returns the list of members in the cluster.
func (ClusterController) MemberRemove ¶
func (c ClusterController) MemberRemove(ctx context.Context, id uint64) (*clientv3.MemberRemoveResponse, error)
MemberRemove removes a member from the cluster.
func (ClusterController) MemberUpdate ¶
func (c ClusterController) MemberUpdate(ctx context.Context, id uint64, addrs []string) (*clientv3.MemberUpdateResponse, error)
MemberUpdate updates the specified member addresses.
type EntityDeleter ¶
type EntityDeleter struct { EntityStore store.EntityStore EventStore store.EventStore }
type ErrCode ¶
type ErrCode uint32
ErrCode is an unsigned 32-bit integer used for defining error codes.
const ( // InternalErr refers to an issue that occured in the underlying system. Eg. // if etcd was unreachable or something was implemented incorrectly. InternalErr ErrCode = iota // InvalidArgument refers to an issue with the arguments the user provided. // Eg. if arguments were of the wrong type or if the purposed changes cause // the record's validation to fail. InvalidArgument // NotFound means that the requested resource is unreachable or does not // exist. NotFound // AlreadyExistsErr means that a create operation failed because the given // resource already exists in the system. AlreadyExistsErr // PermissionDenied means that the viewer does not have permission to perform // the action they are attempting. Is not used when user is unauthenticated. // Eg. if the viewer is trying to list all events but doesn't not have the // approriate roles for the operation. PermissionDenied // Unauthenticated used when viewer is not authenticated but action requires // viewer to be authenticated. Unauthenticated // PaymentRequired is used when the user tries to use a feature that's gated // behind a license. PaymentRequired )
func StatusFromError ¶
StatusFromError extracts code from the given error.
type Error ¶
type Error struct { // Code refers to predefined codes that describe type of error that occurred. Code ErrCode // Message is a developer / operator friendly message briefly describing what // occurred. Message string }
Error describes an issue that ocurred while performing the action. TODO: This should likely be moved to the types package.
type EventController ¶
type EventController struct {
// contains filtered or unexported fields
}
EventController expose actions in which a viewer can perform.
func NewEventController ¶
func NewEventController(store store.EventStore, bus messaging.MessageBus) EventController
NewEventController returns new EventController
func (EventController) Create ¶
Create creates the event indicated by the supplied entity and check. If an event already exists for the entity and check, it updates that event.
func (EventController) CreateOrReplace ¶
CreateOrReplace creates the event indicated by the supplied entity and check. If an event already exists for the entity and check, it updates that event.
func (EventController) Delete ¶
func (a EventController) Delete(ctx context.Context, entity, check string) error
Delete destroys the event indicated by the supplied entity and check.
func (EventController) Get ¶
Get returns resource associated with given parameters if available to the viewer.
func (EventController) List ¶
func (a EventController) List(ctx context.Context, pred *store.SelectionPredicate) ([]corev2.Resource, error)
List returns resources available to the viewer filter by given params.
type HealthController ¶
type HealthController struct {
// contains filtered or unexported fields
}
HealthController exposes actions which a viewer can perform
func NewHealthController ¶
func NewHealthController(store store.HealthStore, cluster clientv3.Cluster, etcdClientTLSConfig *tls.Config) HealthController
NewHealthController returns new HealthController
func (HealthController) GetClusterHealth ¶
func (h HealthController) GetClusterHealth(ctx context.Context) *types.HealthResponse
GetClusterHealth returns health information
type QueryParams ¶
QueryParams keys inwhich to filter results of query.
type SilencedController ¶
type SilencedController struct {
Store store.SilencedStore
}
SilencedController exposes actions in which a viewer can perform.
func NewSilencedController ¶
func NewSilencedController(store store.SilencedStore) SilencedController
NewSilencedController returns new SilencedController
func (SilencedController) Create ¶
Create creates a new silenced entry. It returns an error if the entry already exists.
func (SilencedController) CreateOrReplace ¶
CreateOrReplace creates or replaces a silenced entry.
type TessenController ¶
type TessenController struct {
// contains filtered or unexported fields
}
TessenController exposes actions which a viewer can perform
func NewTessenController ¶
func NewTessenController(store store.TessenConfigStore, bus messaging.MessageBus) TessenController
NewTessenController returns a new TessenController
func (TessenController) CreateOrUpdate ¶
func (c TessenController) CreateOrUpdate(ctx context.Context, config *corev2.TessenConfig) error
CreateOrUpdate creates or updates the tessen configuration
func (TessenController) Get ¶
func (c TessenController) Get(ctx context.Context) (*corev2.TessenConfig, error)
Get gets the tessen configuration
type TessenMetricController ¶
type TessenMetricController struct {
// contains filtered or unexported fields
}
TessenMetricController exposes actions which a viewer can perform
func NewTessenMetricController ¶
func NewTessenMetricController(bus messaging.MessageBus) TessenMetricController
NewTessenMetricController returns a new TessenMetricController
func (TessenMetricController) Publish ¶
func (c TessenMetricController) Publish(ctx context.Context, metrics []corev2.MetricPoint) error
Publish publishes the metrics to the message bus used by TessenD
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController exposes actions in which a viewer can perform.
func NewUserController ¶
func NewUserController(store store.Store) UserController
NewUserController returns new UserController
func (UserController) Create ¶
Create creates a new user. It returns an error if the user already exists.
func (UserController) CreateOrReplace ¶
CreateOrReplace creates or replaces a user.
func (UserController) Disable ¶
func (a UserController) Disable(ctx context.Context, name string) error
Disable disables user identified by given name if viewer has access.
func (UserController) Enable ¶
func (a UserController) Enable(ctx context.Context, name string) error
Enable disables user identified by given name if viewer has access.
func (UserController) Get ¶
Get returns resource associated with given parameters if available to the viewer.
func (UserController) List ¶
func (a UserController) List(ctx context.Context, pred *store.SelectionPredicate) ([]corev2.Resource, error)
List returns resources available to the viewer filter by given params.
func (UserController) RemoveAllGroups ¶
func (a UserController) RemoveAllGroups(ctx context.Context, username string) error
RemoveAllGroups removes all groups from a given user
func (UserController) RemoveGroup ¶
RemoveGroup removes a group from a given user
type VersionController ¶
type VersionController struct {
// contains filtered or unexported fields
}
VersionController exposes actions which a viewer can perform
func NewVersionController ¶
func NewVersionController(clusterVersion string) VersionController
NewVersionController returns a new VersionController
func (VersionController) GetVersion ¶
func (v VersionController) GetVersion(ctx context.Context) *corev2.Version
GetVersion returns version information