Documentation
¶
Overview ¶
Package types is a generated protocol buffer package.
It is generated from these files:
adhoc.proto any.proto asset.proto authentication.proto check.proto entity.proto environment.proto error.proto event.proto extension.proto filter.proto handler.proto hook.proto keepalive.proto metrics.proto mutator.proto organization.proto rbac.proto silenced.proto time_window.proto tls.proto user.proto
It has these top-level messages:
AdhocRequest Any Asset Tokens CheckRequest ProxyRequests CheckConfig Check CheckHistory Entity System Network NetworkInterface Deregistration Environment Error Event Extension EventFilter Handler HandlerSocket HookConfig Hook HookList KeepaliveRecord Metrics MetricPoint MetricTag Mutator Organization Rule Role Silenced TimeWindowWhen TimeWindowDays TimeWindowTimeRange TLSOptions User
Index ¶
- Constants
- Variables
- func ContextEnvironment(ctx context.Context) string
- func ContextOrganization(ctx context.Context) string
- func EnvVarsToMap(vars []string) map[string]string
- func EventsBySeverity(es []*Event) sort.Interface
- func EventsByTimestamp(es []*Event, asc bool) sort.Interface
- func GetEntitySubscription(entityID string) string
- func SetContextFromResource(ctx context.Context, r MultitenantResource) context.Context
- func SilencedID(subscription, check string) (string, error)
- func SortCheckConfigsByName(es []*CheckConfig, asc bool) sort.Interface
- func SortCheckConfigsByPredicate(cs []*CheckConfig, fn cmpCheckConfig) sort.Interface
- func SortEntitiesByID(es []*Entity, asc bool) sort.Interface
- func SortEntitiesByLastSeen(es []*Entity) sort.Interface
- func SortEntitiesByPredicate(es []*Entity, fn func(a, b *Entity) bool) sort.Interface
- func ValidateAssetName(name string) error
- func ValidateEnvVars(vars []string) error
- func ValidateName(name string) error
- func ValidateNameStrict(name string) error
- func ValidateOutputMetricFormat(format string) error
- func ValidateSubscriptionName(name string) error
- type AdhocRequest
- func (*AdhocRequest) Descriptor() ([]byte, []int)
- func (this *AdhocRequest) Equal(that interface{}) bool
- func (m *AdhocRequest) GetCreator() string
- func (m *AdhocRequest) GetName() string
- func (m *AdhocRequest) GetReason() string
- func (m *AdhocRequest) GetSubscriptions() []string
- func (m *AdhocRequest) Marshal() (dAtA []byte, err error)
- func (m *AdhocRequest) MarshalTo(dAtA []byte) (int, error)
- func (*AdhocRequest) ProtoMessage()
- func (m *AdhocRequest) Reset()
- func (m *AdhocRequest) Size() (n int)
- func (m *AdhocRequest) String() string
- func (a *AdhocRequest) URIPath() string
- func (m *AdhocRequest) Unmarshal(dAtA []byte) error
- func (a *AdhocRequest) Validate() error
- type AgentHandshake
- type Any
- func (*Any) Descriptor() ([]byte, []int)
- func (this *Any) Equal(that interface{}) bool
- func (m *Any) GetTypeUrl() string
- func (m *Any) GetValue() []byte
- func (m *Any) Marshal() (dAtA []byte, err error)
- func (m *Any) MarshalTo(dAtA []byte) (int, error)
- func (*Any) ProtoMessage()
- func (m *Any) Reset()
- func (m *Any) Size() (n int)
- func (m *Any) String() string
- func (m *Any) Unmarshal(dAtA []byte) error
- type Asset
- func (*Asset) Descriptor() ([]byte, []int)
- func (this *Asset) Equal(that interface{}) bool
- func (a *Asset) Filename() string
- func (a *Asset) GetEnvironment() string
- func (m *Asset) GetFilters() []string
- func (m *Asset) GetMetadata() map[string]string
- func (m *Asset) GetName() string
- func (m *Asset) GetOrganization() string
- func (m *Asset) GetSha512() string
- func (m *Asset) GetURL() string
- func (m *Asset) Marshal() (dAtA []byte, err error)
- func (m *Asset) MarshalTo(dAtA []byte) (int, error)
- func (*Asset) ProtoMessage()
- func (m *Asset) Reset()
- func (m *Asset) Size() (n int)
- func (m *Asset) String() string
- func (a *Asset) URIPath() string
- func (m *Asset) Unmarshal(dAtA []byte) error
- func (a *Asset) Validate() error
- type BackendHandshake
- type ByExecuted
- type Check
- func (*Check) Descriptor() ([]byte, []int)
- func (this *Check) Equal(that interface{}) bool
- func (c *Check) Get(name string) (interface{}, error)
- func (m *Check) GetCheckHooks() []HookList
- func (m *Check) GetCommand() string
- func (m *Check) GetCron() string
- func (m *Check) GetDuration() float64
- func (m *Check) GetEnvVars() []string
- func (m *Check) GetEnvironment() string
- func (m *Check) GetExecuted() int64
- func (m *Check) GetExtendedAttributes() []byte
- func (m *Check) GetHandlers() []string
- func (m *Check) GetHighFlapThreshold() uint32
- func (m *Check) GetHistory() []CheckHistory
- func (m *Check) GetHooks() []*Hook
- func (m *Check) GetInterval() uint32
- func (m *Check) GetIssued() int64
- func (m *Check) GetLastOK() int64
- func (m *Check) GetLowFlapThreshold() uint32
- func (m *Check) GetName() string
- func (m *Check) GetOccurrences() int64
- func (m *Check) GetOccurrencesWatermark() int64
- func (m *Check) GetOrganization() string
- func (m *Check) GetOutput() string
- func (m *Check) GetOutputMetricFormat() string
- func (m *Check) GetOutputMetricHandlers() []string
- func (m *Check) GetProxyEntityID() string
- func (m *Check) GetProxyRequests() *ProxyRequests
- func (m *Check) GetPublish() bool
- func (m *Check) GetRoundRobin() bool
- func (m *Check) GetRuntimeAssets() []string
- func (m *Check) GetSilenced() []string
- func (m *Check) GetState() string
- func (m *Check) GetStatus() uint32
- func (m *Check) GetStdin() bool
- func (m *Check) GetSubdue() *TimeWindowWhen
- func (m *Check) GetSubscriptions() []string
- func (m *Check) GetTimeout() uint32
- func (m *Check) GetTotalStateChange() uint32
- func (m *Check) GetTtl() int64
- func (m *Check) Marshal() (dAtA []byte, err error)
- func (c *Check) MarshalJSON() ([]byte, error)
- func (m *Check) MarshalTo(dAtA []byte) (int, error)
- func (c *Check) MergeWith(prevCheck *Check)
- func (*Check) ProtoMessage()
- func (m *Check) Reset()
- func (c *Check) SetExtendedAttributes(e []byte)
- func (m *Check) Size() (n int)
- func (m *Check) String() string
- func (c *Check) URIPath() string
- func (m *Check) Unmarshal(dAtA []byte) error
- func (c *Check) UnmarshalJSON(b []byte) error
- func (c *Check) Validate() error
- type CheckConfig
- func (*CheckConfig) Descriptor() ([]byte, []int)
- func (this *CheckConfig) Equal(that interface{}) bool
- func (c *CheckConfig) Get(name string) (interface{}, error)
- func (m *CheckConfig) GetCheckHooks() []HookList
- func (m *CheckConfig) GetCommand() string
- func (m *CheckConfig) GetCron() string
- func (m *CheckConfig) GetEnvVars() []string
- func (m *CheckConfig) GetEnvironment() string
- func (m *CheckConfig) GetExtendedAttributes() []byte
- func (m *CheckConfig) GetHandlers() []string
- func (m *CheckConfig) GetHighFlapThreshold() uint32
- func (m *CheckConfig) GetInterval() uint32
- func (m *CheckConfig) GetLowFlapThreshold() uint32
- func (m *CheckConfig) GetName() string
- func (m *CheckConfig) GetOrganization() string
- func (m *CheckConfig) GetOutputMetricFormat() string
- func (m *CheckConfig) GetOutputMetricHandlers() []string
- func (m *CheckConfig) GetProxyEntityID() string
- func (m *CheckConfig) GetProxyRequests() *ProxyRequests
- func (m *CheckConfig) GetPublish() bool
- func (m *CheckConfig) GetRoundRobin() bool
- func (m *CheckConfig) GetRuntimeAssets() []string
- func (m *CheckConfig) GetStdin() bool
- func (m *CheckConfig) GetSubdue() *TimeWindowWhen
- func (m *CheckConfig) GetSubscriptions() []string
- func (m *CheckConfig) GetTimeout() uint32
- func (m *CheckConfig) GetTtl() int64
- func (c *CheckConfig) IsSubdued() bool
- func (m *CheckConfig) Marshal() (dAtA []byte, err error)
- func (c *CheckConfig) MarshalJSON() ([]byte, error)
- func (m *CheckConfig) MarshalTo(dAtA []byte) (int, error)
- func (*CheckConfig) ProtoMessage()
- func (m *CheckConfig) Reset()
- func (c *CheckConfig) SetExtendedAttributes(e []byte)
- func (m *CheckConfig) Size() (n int)
- func (m *CheckConfig) String() string
- func (c *CheckConfig) URIPath() string
- func (m *CheckConfig) Unmarshal(dAtA []byte) error
- func (c *CheckConfig) UnmarshalJSON(b []byte) error
- func (c *CheckConfig) Validate() error
- type CheckHistory
- func (*CheckHistory) Descriptor() ([]byte, []int)
- func (this *CheckHistory) Equal(that interface{}) bool
- func (m *CheckHistory) GetExecuted() int64
- func (m *CheckHistory) GetStatus() uint32
- func (m *CheckHistory) Marshal() (dAtA []byte, err error)
- func (m *CheckHistory) MarshalTo(dAtA []byte) (int, error)
- func (*CheckHistory) ProtoMessage()
- func (m *CheckHistory) Reset()
- func (m *CheckHistory) Size() (n int)
- func (m *CheckHistory) String() string
- func (m *CheckHistory) Unmarshal(dAtA []byte) error
- type CheckRequest
- func (*CheckRequest) Descriptor() ([]byte, []int)
- func (this *CheckRequest) Equal(that interface{}) bool
- func (m *CheckRequest) GetAssets() []Asset
- func (m *CheckRequest) GetConfig() *CheckConfig
- func (m *CheckRequest) GetHooks() []HookConfig
- func (m *CheckRequest) GetIssued() int64
- func (m *CheckRequest) Marshal() (dAtA []byte, err error)
- func (m *CheckRequest) MarshalTo(dAtA []byte) (int, error)
- func (*CheckRequest) ProtoMessage()
- func (m *CheckRequest) Reset()
- func (m *CheckRequest) Size() (n int)
- func (m *CheckRequest) String() string
- func (m *CheckRequest) Unmarshal(dAtA []byte) error
- type Claims
- type ConstrainedResource
- type Deregistration
- func (*Deregistration) Descriptor() ([]byte, []int)
- func (this *Deregistration) Equal(that interface{}) bool
- func (m *Deregistration) GetHandler() string
- func (m *Deregistration) Marshal() (dAtA []byte, err error)
- func (m *Deregistration) MarshalTo(dAtA []byte) (int, error)
- func (*Deregistration) ProtoMessage()
- func (m *Deregistration) Reset()
- func (m *Deregistration) Size() (n int)
- func (m *Deregistration) String() string
- func (m *Deregistration) Unmarshal(dAtA []byte) error
- type Entity
- func (*Entity) Descriptor() ([]byte, []int)
- func (this *Entity) Equal(that interface{}) bool
- func (e *Entity) Get(name string) (interface{}, error)
- func (m *Entity) GetClass() string
- func (m *Entity) GetDeregister() bool
- func (m *Entity) GetDeregistration() Deregistration
- func (m *Entity) GetEnvironment() string
- func (m *Entity) GetExtendedAttributes() []byte
- func (m *Entity) GetID() string
- func (m *Entity) GetKeepaliveTimeout() uint32
- func (m *Entity) GetLastSeen() int64
- func (m *Entity) GetOrganization() string
- func (m *Entity) GetRedact() []string
- func (m *Entity) GetSubscriptions() []string
- func (m *Entity) GetSystem() System
- func (m *Entity) GetUser() string
- func (m *Entity) Marshal() (dAtA []byte, err error)
- func (e *Entity) MarshalJSON() ([]byte, error)
- func (m *Entity) MarshalTo(dAtA []byte) (int, error)
- func (*Entity) ProtoMessage()
- func (m *Entity) Reset()
- func (e *Entity) SetExtendedAttributes(b []byte)
- func (m *Entity) Size() (n int)
- func (m *Entity) String() string
- func (e *Entity) URIPath() string
- func (m *Entity) Unmarshal(dAtA []byte) error
- func (e *Entity) UnmarshalJSON(b []byte) error
- func (e *Entity) Validate() error
- type Environment
- func (*Environment) Descriptor() ([]byte, []int)
- func (this *Environment) Equal(that interface{}) bool
- func (m *Environment) GetDescription() string
- func (e *Environment) GetEnvironment() string
- func (m *Environment) GetName() string
- func (m *Environment) GetOrganization() string
- func (m *Environment) Marshal() (dAtA []byte, err error)
- func (m *Environment) MarshalTo(dAtA []byte) (int, error)
- func (*Environment) ProtoMessage()
- func (m *Environment) Reset()
- func (m *Environment) Size() (n int)
- func (m *Environment) String() string
- func (e *Environment) URIPath() string
- func (m *Environment) Unmarshal(dAtA []byte) error
- func (e *Environment) Update(from *Environment, fields ...string) error
- func (e *Environment) Validate() error
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (this *Error) Equal(that interface{}) bool
- func (m *Error) GetComponent() string
- func (perr *Error) GetEnvironment() string
- func (m *Error) GetEvent() Event
- func (m *Error) GetMessage() string
- func (m *Error) GetName() string
- func (perr *Error) GetOrganization() string
- func (m *Error) GetTimestamp() int64
- func (m *Error) Marshal() (dAtA []byte, err error)
- func (m *Error) MarshalTo(dAtA []byte) (int, error)
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) Size() (n int)
- func (m *Error) String() string
- func (m *Error) Unmarshal(dAtA []byte) error
- type Event
- func (*Event) Descriptor() ([]byte, []int)
- func (this *Event) Equal(that interface{}) bool
- func (e *Event) Get(name string) (interface{}, error)
- func (m *Event) GetCheck() *Check
- func (m *Event) GetEntity() *Entity
- func (m *Event) GetHooks() []*Hook
- func (m *Event) GetMetrics() *Metrics
- func (m *Event) GetSilenced() []string
- func (m *Event) GetTimestamp() int64
- func (e *Event) HasCheck() bool
- func (e *Event) HasMetrics() bool
- func (e *Event) IsIncident() bool
- func (e *Event) IsResolution() bool
- func (e *Event) IsSilenced() bool
- func (m *Event) Marshal() (dAtA []byte, err error)
- func (m *Event) MarshalTo(dAtA []byte) (int, error)
- func (*Event) ProtoMessage()
- func (m *Event) Reset()
- func (m *Event) Size() (n int)
- func (m *Event) String() string
- func (e *Event) URIPath() string
- func (m *Event) Unmarshal(dAtA []byte) error
- func (e *Event) UnmarshalJSON(b []byte) error
- func (e *Event) Validate() error
- type EventFilter
- func (*EventFilter) Descriptor() ([]byte, []int)
- func (this *EventFilter) Equal(that interface{}) bool
- func (m *EventFilter) GetAction() string
- func (m *EventFilter) GetEnvironment() string
- func (m *EventFilter) GetName() string
- func (m *EventFilter) GetOrganization() string
- func (m *EventFilter) GetStatements() []string
- func (m *EventFilter) GetWhen() *TimeWindowWhen
- func (m *EventFilter) Marshal() (dAtA []byte, err error)
- func (m *EventFilter) MarshalTo(dAtA []byte) (int, error)
- func (*EventFilter) ProtoMessage()
- func (m *EventFilter) Reset()
- func (m *EventFilter) Size() (n int)
- func (m *EventFilter) String() string
- func (f *EventFilter) URIPath() string
- func (m *EventFilter) Unmarshal(dAtA []byte) error
- func (f *EventFilter) Update(from *EventFilter, fields ...string) error
- func (f *EventFilter) Validate() error
- type Extension
- func (*Extension) Descriptor() ([]byte, []int)
- func (this *Extension) Equal(that interface{}) bool
- func (e *Extension) GetEnvironment() string
- func (m *Extension) GetName() string
- func (m *Extension) GetOrganization() string
- func (m *Extension) GetURL() string
- func (m *Extension) Marshal() (dAtA []byte, err error)
- func (m *Extension) MarshalTo(dAtA []byte) (int, error)
- func (*Extension) ProtoMessage()
- func (m *Extension) Reset()
- func (m *Extension) Size() (n int)
- func (m *Extension) String() string
- func (e *Extension) URIPath() string
- func (m *Extension) Unmarshal(dAtA []byte) error
- func (e *Extension) Validate() error
- type Handler
- func (*Handler) Descriptor() ([]byte, []int)
- func (this *Handler) Equal(that interface{}) bool
- func (m *Handler) GetCommand() string
- func (m *Handler) GetEnvVars() []string
- func (m *Handler) GetEnvironment() string
- func (m *Handler) GetFilters() []string
- func (m *Handler) GetHandlers() []string
- func (m *Handler) GetMutator() string
- func (m *Handler) GetName() string
- func (m *Handler) GetOrganization() string
- func (m *Handler) GetSocket() *HandlerSocket
- func (m *Handler) GetTimeout() uint32
- func (m *Handler) GetType() string
- func (m *Handler) Marshal() (dAtA []byte, err error)
- func (m *Handler) MarshalTo(dAtA []byte) (int, error)
- func (*Handler) ProtoMessage()
- func (m *Handler) Reset()
- func (m *Handler) Size() (n int)
- func (m *Handler) String() string
- func (h *Handler) URIPath() string
- func (m *Handler) Unmarshal(dAtA []byte) error
- func (h *Handler) Validate() error
- type HandlerSocket
- func (*HandlerSocket) Descriptor() ([]byte, []int)
- func (this *HandlerSocket) Equal(that interface{}) bool
- func (m *HandlerSocket) GetHost() string
- func (m *HandlerSocket) GetPort() uint32
- func (m *HandlerSocket) Marshal() (dAtA []byte, err error)
- func (m *HandlerSocket) MarshalTo(dAtA []byte) (int, error)
- func (*HandlerSocket) ProtoMessage()
- func (m *HandlerSocket) Reset()
- func (m *HandlerSocket) Size() (n int)
- func (m *HandlerSocket) String() string
- func (m *HandlerSocket) Unmarshal(dAtA []byte) error
- func (s *HandlerSocket) Validate() error
- type Hook
- func (*Hook) Descriptor() ([]byte, []int)
- func (this *Hook) Equal(that interface{}) bool
- func (m *Hook) GetDuration() float64
- func (m *Hook) GetExecuted() int64
- func (m *Hook) GetIssued() int64
- func (m *Hook) GetOutput() string
- func (m *Hook) GetStatus() int32
- func (m *Hook) Marshal() (dAtA []byte, err error)
- func (m *Hook) MarshalTo(dAtA []byte) (int, error)
- func (*Hook) ProtoMessage()
- func (m *Hook) Reset()
- func (m *Hook) Size() (n int)
- func (m *Hook) String() string
- func (h *Hook) URIPath() string
- func (m *Hook) Unmarshal(dAtA []byte) error
- func (h *Hook) Validate() error
- type HookConfig
- func (*HookConfig) Descriptor() ([]byte, []int)
- func (this *HookConfig) Equal(that interface{}) bool
- func (m *HookConfig) GetCommand() string
- func (m *HookConfig) GetEnvironment() string
- func (m *HookConfig) GetName() string
- func (m *HookConfig) GetOrganization() string
- func (m *HookConfig) GetStdin() bool
- func (m *HookConfig) GetTimeout() uint32
- func (m *HookConfig) Marshal() (dAtA []byte, err error)
- func (m *HookConfig) MarshalTo(dAtA []byte) (int, error)
- func (*HookConfig) ProtoMessage()
- func (m *HookConfig) Reset()
- func (m *HookConfig) Size() (n int)
- func (m *HookConfig) String() string
- func (c *HookConfig) URIPath() string
- func (m *HookConfig) Unmarshal(dAtA []byte) error
- func (c *HookConfig) Validate() error
- type HookList
- func (*HookList) Descriptor() ([]byte, []int)
- func (this *HookList) Equal(that interface{}) bool
- func (m *HookList) GetHooks() []string
- func (m *HookList) GetType() string
- func (m *HookList) Marshal() (dAtA []byte, err error)
- func (h *HookList) MarshalJSON() ([]byte, error)
- func (m *HookList) MarshalTo(dAtA []byte) (int, error)
- func (*HookList) ProtoMessage()
- func (m *HookList) Reset()
- func (m *HookList) Size() (n int)
- func (m *HookList) String() string
- func (m *HookList) Unmarshal(dAtA []byte) error
- func (h *HookList) UnmarshalJSON(b []byte) error
- func (h *HookList) Validate() error
- type KeepaliveRecord
- func (*KeepaliveRecord) Descriptor() ([]byte, []int)
- func (this *KeepaliveRecord) Equal(that interface{}) bool
- func (m *KeepaliveRecord) GetEntityID() string
- func (m *KeepaliveRecord) GetEnvironment() string
- func (m *KeepaliveRecord) GetOrganization() string
- func (m *KeepaliveRecord) GetTime() int64
- func (m *KeepaliveRecord) Marshal() (dAtA []byte, err error)
- func (m *KeepaliveRecord) MarshalTo(dAtA []byte) (int, error)
- func (*KeepaliveRecord) ProtoMessage()
- func (m *KeepaliveRecord) Reset()
- func (m *KeepaliveRecord) Size() (n int)
- func (m *KeepaliveRecord) String() string
- func (m *KeepaliveRecord) Unmarshal(dAtA []byte) error
- type MetricPoint
- func (*MetricPoint) Descriptor() ([]byte, []int)
- func (this *MetricPoint) Equal(that interface{}) bool
- func (m *MetricPoint) GetName() string
- func (m *MetricPoint) GetTags() []*MetricTag
- func (m *MetricPoint) GetTimestamp() int64
- func (m *MetricPoint) GetValue() float64
- func (m *MetricPoint) Marshal() (dAtA []byte, err error)
- func (m *MetricPoint) MarshalTo(dAtA []byte) (int, error)
- func (*MetricPoint) ProtoMessage()
- func (m *MetricPoint) Reset()
- func (m *MetricPoint) Size() (n int)
- func (m *MetricPoint) String() string
- func (m *MetricPoint) Unmarshal(dAtA []byte) error
- type MetricTag
- func (*MetricTag) Descriptor() ([]byte, []int)
- func (this *MetricTag) Equal(that interface{}) bool
- func (m *MetricTag) GetName() string
- func (m *MetricTag) GetValue() string
- func (m *MetricTag) Marshal() (dAtA []byte, err error)
- func (m *MetricTag) MarshalTo(dAtA []byte) (int, error)
- func (*MetricTag) ProtoMessage()
- func (m *MetricTag) Reset()
- func (m *MetricTag) Size() (n int)
- func (m *MetricTag) String() string
- func (m *MetricTag) Unmarshal(dAtA []byte) error
- type Metrics
- func (*Metrics) Descriptor() ([]byte, []int)
- func (this *Metrics) Equal(that interface{}) bool
- func (m *Metrics) GetHandlers() []string
- func (m *Metrics) GetPoints() []*MetricPoint
- func (m *Metrics) Marshal() (dAtA []byte, err error)
- func (m *Metrics) MarshalTo(dAtA []byte) (int, error)
- func (*Metrics) ProtoMessage()
- func (m *Metrics) Reset()
- func (m *Metrics) Size() (n int)
- func (m *Metrics) String() string
- func (m *Metrics) Unmarshal(dAtA []byte) error
- func (m *Metrics) Validate() error
- type MultitenantResource
- type Mutator
- func (*Mutator) Descriptor() ([]byte, []int)
- func (this *Mutator) Equal(that interface{}) bool
- func (m *Mutator) GetCommand() string
- func (m *Mutator) GetEnvVars() []string
- func (m *Mutator) GetEnvironment() string
- func (m *Mutator) GetName() string
- func (m *Mutator) GetOrganization() string
- func (m *Mutator) GetTimeout() uint32
- func (m *Mutator) Marshal() (dAtA []byte, err error)
- func (m *Mutator) MarshalTo(dAtA []byte) (int, error)
- func (*Mutator) ProtoMessage()
- func (m *Mutator) Reset()
- func (m *Mutator) Size() (n int)
- func (m *Mutator) String() string
- func (m *Mutator) URIPath() string
- func (m *Mutator) Unmarshal(dAtA []byte) error
- func (m *Mutator) Update(from *Mutator, fields ...string) error
- func (m *Mutator) Validate() error
- type Network
- func (*Network) Descriptor() ([]byte, []int)
- func (this *Network) Equal(that interface{}) bool
- func (m *Network) GetInterfaces() []NetworkInterface
- func (m *Network) Marshal() (dAtA []byte, err error)
- func (m *Network) MarshalTo(dAtA []byte) (int, error)
- func (*Network) ProtoMessage()
- func (m *Network) Reset()
- func (m *Network) Size() (n int)
- func (m *Network) String() string
- func (m *Network) Unmarshal(dAtA []byte) error
- type NetworkInterface
- func (*NetworkInterface) Descriptor() ([]byte, []int)
- func (this *NetworkInterface) Equal(that interface{}) bool
- func (m *NetworkInterface) GetAddresses() []string
- func (m *NetworkInterface) GetMAC() string
- func (m *NetworkInterface) GetName() string
- func (m *NetworkInterface) Marshal() (dAtA []byte, err error)
- func (m *NetworkInterface) MarshalTo(dAtA []byte) (int, error)
- func (*NetworkInterface) ProtoMessage()
- func (m *NetworkInterface) Reset()
- func (m *NetworkInterface) Size() (n int)
- func (m *NetworkInterface) String() string
- func (m *NetworkInterface) Unmarshal(dAtA []byte) error
- type Organization
- func (*Organization) Descriptor() ([]byte, []int)
- func (this *Organization) Equal(that interface{}) bool
- func (m *Organization) GetDescription() string
- func (m *Organization) GetName() string
- func (m *Organization) Marshal() (dAtA []byte, err error)
- func (m *Organization) MarshalTo(dAtA []byte) (int, error)
- func (*Organization) ProtoMessage()
- func (m *Organization) Reset()
- func (m *Organization) Size() (n int)
- func (m *Organization) String() string
- func (o *Organization) URIPath() string
- func (m *Organization) Unmarshal(dAtA []byte) error
- func (o *Organization) Validate() error
- type ProxyRequests
- func (*ProxyRequests) Descriptor() ([]byte, []int)
- func (this *ProxyRequests) Equal(that interface{}) bool
- func (m *ProxyRequests) GetEntityAttributes() []string
- func (m *ProxyRequests) GetSplay() bool
- func (m *ProxyRequests) GetSplayCoverage() uint32
- func (m *ProxyRequests) Marshal() (dAtA []byte, err error)
- func (m *ProxyRequests) MarshalTo(dAtA []byte) (int, error)
- func (*ProxyRequests) ProtoMessage()
- func (m *ProxyRequests) Reset()
- func (m *ProxyRequests) Size() (n int)
- func (m *ProxyRequests) String() string
- func (m *ProxyRequests) Unmarshal(dAtA []byte) error
- func (p *ProxyRequests) Validate() error
- type Queue
- type QueueGetter
- type QueueItem
- type Resource
- type Ring
- type RingGetter
- type Role
- func (*Role) Descriptor() ([]byte, []int)
- func (this *Role) Equal(that interface{}) bool
- func (m *Role) GetName() string
- func (m *Role) GetRules() []Rule
- func (m *Role) Marshal() (dAtA []byte, err error)
- func (m *Role) MarshalTo(dAtA []byte) (int, error)
- func (*Role) ProtoMessage()
- func (m *Role) Reset()
- func (m *Role) Size() (n int)
- func (m *Role) String() string
- func (r *Role) URIPath() string
- func (m *Role) Unmarshal(dAtA []byte) error
- func (r *Role) Validate() error
- type Rule
- func (*Rule) Descriptor() ([]byte, []int)
- func (this *Rule) Equal(that interface{}) bool
- func (m *Rule) GetEnvironment() string
- func (m *Rule) GetOrganization() string
- func (m *Rule) GetPermissions() []string
- func (m *Rule) GetType() string
- func (m *Rule) Marshal() (dAtA []byte, err error)
- func (m *Rule) MarshalTo(dAtA []byte) (int, error)
- func (*Rule) ProtoMessage()
- func (m *Rule) Reset()
- func (m *Rule) Size() (n int)
- func (m *Rule) String() string
- func (m *Rule) Unmarshal(dAtA []byte) error
- func (r *Rule) Validate() error
- type Silenced
- func (*Silenced) Descriptor() ([]byte, []int)
- func (this *Silenced) Equal(that interface{}) bool
- func (m *Silenced) GetBegin() int64
- func (m *Silenced) GetCheck() string
- func (m *Silenced) GetCreator() string
- func (m *Silenced) GetEnvironment() string
- func (m *Silenced) GetExpire() int64
- func (m *Silenced) GetExpireOnResolve() bool
- func (m *Silenced) GetID() string
- func (m *Silenced) GetOrganization() string
- func (m *Silenced) GetReason() string
- func (m *Silenced) GetSubscription() string
- func (m *Silenced) Marshal() (dAtA []byte, err error)
- func (m *Silenced) MarshalTo(dAtA []byte) (int, error)
- func (*Silenced) ProtoMessage()
- func (m *Silenced) Reset()
- func (m *Silenced) Size() (n int)
- func (s *Silenced) StartSilence(currentTime int64) bool
- func (m *Silenced) String() string
- func (s *Silenced) URIPath() string
- func (m *Silenced) Unmarshal(dAtA []byte) error
- func (s *Silenced) Validate() error
- type StatusMap
- type System
- func (*System) Descriptor() ([]byte, []int)
- func (this *System) Equal(that interface{}) bool
- func (m *System) GetArch() string
- func (m *System) GetHostname() string
- func (m *System) GetNetwork() Network
- func (m *System) GetOS() string
- func (m *System) GetPlatform() string
- func (m *System) GetPlatformFamily() string
- func (m *System) GetPlatformVersion() string
- func (m *System) Marshal() (dAtA []byte, err error)
- func (m *System) MarshalTo(dAtA []byte) (int, error)
- func (*System) ProtoMessage()
- func (m *System) Reset()
- func (m *System) Size() (n int)
- func (m *System) String() string
- func (m *System) Unmarshal(dAtA []byte) error
- type TLSOptions
- func (*TLSOptions) Descriptor() ([]byte, []int)
- func (this *TLSOptions) Equal(that interface{}) bool
- func (m *TLSOptions) GetCertFile() string
- func (m *TLSOptions) GetInsecureSkipVerify() bool
- func (m *TLSOptions) GetKeyFile() string
- func (m *TLSOptions) GetTrustedCAFile() string
- func (m *TLSOptions) Marshal() (dAtA []byte, err error)
- func (m *TLSOptions) MarshalTo(dAtA []byte) (int, error)
- func (*TLSOptions) ProtoMessage()
- func (m *TLSOptions) Reset()
- func (m *TLSOptions) Size() (n int)
- func (m *TLSOptions) String() string
- func (t *TLSOptions) ToTLSConfig() (*tls.Config, error)
- func (m *TLSOptions) Unmarshal(dAtA []byte) error
- type TimeWindowDays
- func (*TimeWindowDays) Descriptor() ([]byte, []int)
- func (this *TimeWindowDays) Equal(that interface{}) bool
- func (m *TimeWindowDays) GetAll() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetFriday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetMonday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetSaturday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetSunday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetThursday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetTuesday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) GetWednesday() []*TimeWindowTimeRange
- func (m *TimeWindowDays) Marshal() (dAtA []byte, err error)
- func (m *TimeWindowDays) MarshalTo(dAtA []byte) (int, error)
- func (*TimeWindowDays) ProtoMessage()
- func (m *TimeWindowDays) Reset()
- func (m *TimeWindowDays) Size() (n int)
- func (m *TimeWindowDays) String() string
- func (m *TimeWindowDays) Unmarshal(dAtA []byte) error
- type TimeWindowTimeRange
- func (*TimeWindowTimeRange) Descriptor() ([]byte, []int)
- func (this *TimeWindowTimeRange) Equal(that interface{}) bool
- func (m *TimeWindowTimeRange) GetBegin() string
- func (m *TimeWindowTimeRange) GetEnd() string
- func (t *TimeWindowTimeRange) InWindow(current time.Time) (bool, error)
- func (m *TimeWindowTimeRange) Marshal() (dAtA []byte, err error)
- func (m *TimeWindowTimeRange) MarshalTo(dAtA []byte) (int, error)
- func (*TimeWindowTimeRange) ProtoMessage()
- func (m *TimeWindowTimeRange) Reset()
- func (m *TimeWindowTimeRange) Size() (n int)
- func (m *TimeWindowTimeRange) String() string
- func (m *TimeWindowTimeRange) Unmarshal(dAtA []byte) error
- func (t *TimeWindowTimeRange) Validate() error
- type TimeWindowWhen
- func (*TimeWindowWhen) Descriptor() ([]byte, []int)
- func (this *TimeWindowWhen) Equal(that interface{}) bool
- func (m *TimeWindowWhen) GetDays() TimeWindowDays
- func (t *TimeWindowWhen) InWindows(current time.Time) (bool, error)
- func (t *TimeWindowWhen) MapTimeWindows() map[string][]*TimeWindowTimeRange
- func (m *TimeWindowWhen) Marshal() (dAtA []byte, err error)
- func (m *TimeWindowWhen) MarshalTo(dAtA []byte) (int, error)
- func (*TimeWindowWhen) ProtoMessage()
- func (m *TimeWindowWhen) Reset()
- func (m *TimeWindowWhen) Size() (n int)
- func (m *TimeWindowWhen) String() string
- func (m *TimeWindowWhen) Unmarshal(dAtA []byte) error
- func (t *TimeWindowWhen) Validate() error
- type Tokens
- func (*Tokens) Descriptor() ([]byte, []int)
- func (this *Tokens) Equal(that interface{}) bool
- func (m *Tokens) GetAccess() string
- func (m *Tokens) GetExpiresAt() int64
- func (m *Tokens) GetRefresh() string
- func (m *Tokens) Marshal() (dAtA []byte, err error)
- func (m *Tokens) MarshalTo(dAtA []byte) (int, error)
- func (*Tokens) ProtoMessage()
- func (m *Tokens) Reset()
- func (m *Tokens) Size() (n int)
- func (m *Tokens) String() string
- func (m *Tokens) Unmarshal(dAtA []byte) error
- func (t *Tokens) Validate() error
- type User
- func (*User) Descriptor() ([]byte, []int)
- func (this *User) Equal(that interface{}) bool
- func (m *User) GetDisabled() bool
- func (m *User) GetPassword() string
- func (m *User) GetRoles() []string
- func (m *User) GetUsername() string
- func (m *User) Marshal() (dAtA []byte, err error)
- func (m *User) MarshalTo(dAtA []byte) (int, error)
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (m *User) Size() (n int)
- func (m *User) String() string
- func (m *User) Unmarshal(dAtA []byte) error
- func (u *User) Validate() error
- func (u *User) ValidatePassword() error
- type Wrapper
Constants ¶
const ( // AuthorizationActorKey is the key name used to store a user's details within // a context AuthorizationActorKey key = iota // AuthorizationRoleKey is the key name used to store a user's roles within // a context TODO: Remove AuthorizationRoleKey // AccessTokenClaims contains the key name to retrieve the access token claims AccessTokenClaims // ClaimsKey contains key name to retrieve the jwt claims from context ClaimsKey // EnvironmentKey contains the key name to retrieve the env from context EnvironmentKey // OrganizationKey contains the key name to retrieve the org from context OrganizationKey // RefreshTokenClaims contains the key name to retrieve the refresh token claims RefreshTokenClaims // RefreshTokenString contains the key name to retrieve the refresh token string RefreshTokenString // StoreKey contains the key name to retrieve the etcd store from within a context StoreKey )
const ( // EntityAgentClass is the name of the class given to agent entities. EntityAgentClass = "agent" // EntityProxyClass is the name of the class given to proxy entities. EntityProxyClass = "proxy" )
const ( // EventFilterActionAllow is an action to allow events to pass through to the pipeline EventFilterActionAllow = "allow" // EventFilterActionDeny is an action to deny events from passing through to the pipeline EventFilterActionDeny = "deny" // DefaultEventFilterAction is the default action for filters DefaultEventFilterAction = EventFilterActionAllow )
const ( // HandlerPipeType represents handlers that pipes event data // into arbitrary // commands via STDIN HandlerPipeType = "pipe" // HandlerSetType represents handlers that groups event handlers, making it // easy to manage groups of actions that should be executed for certain types // of events. HandlerSetType = "set" // HandlerTCPType represents handlers that send event data to a remote TCP // socket HandlerTCPType = "tcp" // HandlerUDPType represents handlers that send event data to a remote UDP // socket HandlerUDPType = "udp" )
const ( // RuleTypeAll matches all actions RuleTypeAll = "*" // RulePermCreate create action RulePermCreate = "create" // RulePermRead read action RulePermRead = "read" // RulePermUpdate update action RulePermUpdate = "update" // RulePermDelete delete action RulePermDelete = "delete" // RuleTypeAsset access control for asset objects RuleTypeAsset = "assets" // RuleTypeCheck access control for check objects RuleTypeCheck = "checks" // RuleTypeEntity access control for entity objects RuleTypeEntity = "entities" // RuleTypeEnvironment access control for organization objects RuleTypeEnvironment = "environments" // RuleTypeEvent access control for event objects RuleTypeEvent = "events" // RuleTypeEventFilter access control for filter objects RuleTypeEventFilter = "filters" // RuleTypeExtension access control for extension registry RuleTypeExtension = "extensions" // RuleTypeHandler access control for handler objects RuleTypeHandler = "handlers" // RuleTypeHook access control for hook objects RuleTypeHook = "hooks" // RuleTypeMutator access control for mutator objects RuleTypeMutator = "mutators" // RuleTypeOrganization access control for organization objects RuleTypeOrganization = "organizations" // RuleTypeRole access control for role objects RuleTypeRole = "roles" // RuleTypeSilenced access control for silenced objects RuleTypeSilenced = "silenced" // RuleTypeUser access control for user objects RuleTypeUser = "users" )
const AgentHandshakeType = "agent_handshake"
AgentHandshakeType is the message type string for an AgentHandshake
const BackendHandshakeType = "backend_handshake"
BackendHandshakeType is the message type string for a BackendHandshake
const CheckRequestType = "check_request"
CheckRequestType is the message type string for check request.
const DefaultSplayCoverage = 90.0
DefaultSplayCoverage is the default splay coverage for proxy check requests
const EventFailingState = "failing"
EventFailingState indicates failing check result status
const EventFlappingState = "flapping"
EventFlappingState indicates a rapid change in check result status
const EventPassingState = "passing"
EventPassingState indicates successful check result status
const GraphiteOutputMetricFormat = "graphite_plaintext"
GraphiteOutputMetricFormat is the accepted string to represent the output metric format of Graphite Plain Text
const HookRequestType = "hook_request"
HookRequestType is the message type string for hook request.
const InfluxDBOutputMetricFormat = "influxdb_line"
InfluxDBOutputMetricFormat is the accepted string to represent the output metric format of InfluxDB Line
const NagiosOutputMetricFormat = "nagios_perfdata"
NagiosOutputMetricFormat is the accepted string to represent the output metric format of Nagios Perf Data
const OpenTSDBOutputMetricFormat = "opentsdb_line"
OpenTSDBOutputMetricFormat is the accepted string to represent the output metric format of OpenTSDB Line
Variables ¶
var ( ErrInvalidLengthAdhoc = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAdhoc = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAny = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthAsset = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAsset = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthAuthentication = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAuthentication = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthCheck = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCheck = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthEntity = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEntity = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthEnvironment = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEnvironment = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthError = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowError = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthExtension = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowExtension = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthFilter = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowFilter = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthHandler = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowHandler = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthHook = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowHook = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthKeepalive = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowKeepalive = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthMutator = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMutator = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthOrganization = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowOrganization = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthRbac = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRbac = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthSilenced = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSilenced = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthTimeWindow = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTimeWindow = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthTls = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTls = fmt.Errorf("proto: integer overflow") )
var ( ErrInvalidLengthUser = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowUser = fmt.Errorf("proto: integer overflow") )
var AssetNameRegex = regexp.MustCompile("^" + AssetNameRegexStr + "$")
AssetNameRegex used to validate name of asset
var AssetNameRegexStr = `[a-z0-9\/\_\.\-]+`
AssetNameRegexStr used to validate name of asset
var CheckHookRegex = regexp.MustCompile("^" + CheckHookRegexStr + "$")
CheckHookRegex used to validate type of check hook
var CheckHookRegexStr = `([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])`
CheckHookRegexStr used to validate type of check hook
var ( // EventFilterAllActions is a list of actions that can be used by filters EventFilterAllActions = []string{ EventFilterActionAllow, EventFilterActionDeny, } )
var NameRegex = regexp.MustCompile(`\A[\w\.\-]+\z`)
NameRegex is used to validate the name of a resource
var OutputMetricFormats = []string{NagiosOutputMetricFormat, GraphiteOutputMetricFormat, OpenTSDBOutputMetricFormat, InfluxDBOutputMetricFormat}
OutputMetricFormats represents all the accepted output_metric_format's a check can have
var ( // RuleAllPerms all actions RuleAllPerms = []string{ RulePermCreate, RulePermRead, RulePermUpdate, RulePermDelete, } )
var Severities = []string{"ok", "warning", "critical", "unknown", "non-zero"}
Severities used to validate type of check hook
var StrictNameRegex = regexp.MustCompile(`\A[a-z0-9\_\.\-]+\z`)
StrictNameRegex is used to validate names of resources using a strict subset of charset.
var SubscriptionNameRegex = regexp.MustCompile(`\A[\w\.\-]+\:?[\w\.\-]+\z`)
SubscriptionNameRegex is used to validate the name of a subscription, which can contain a single ":" character in case of an entity subscription (e.g. entity:foo)
Functions ¶
func ContextEnvironment ¶
ContextEnvironment returns the environment name injected in the context
func ContextOrganization ¶
ContextOrganization returns the organization name injected in the context
func EnvVarsToMap ¶
EnvVarsToMap converts a list of FOO=BAR key-value pairs into a map.
func EventsBySeverity ¶
EventsBySeverity can be used to sort a given collection of events by check status and timestamp.
func EventsByTimestamp ¶
EventsByTimestamp can be used to sort a given collection of events by time it occurred.
func GetEntitySubscription ¶
GetEntitySubscription returns the entity subscription, using the format "entity:entityID"
func SetContextFromResource ¶
func SetContextFromResource(ctx context.Context, r MultitenantResource) context.Context
SetContextFromResource takes a context and a multi-tenant resource, adds the environment and organization to the context, and returns the udpated context
func SilencedID ¶
SilencedID returns the canonical ID for a silenced entry. It returns non-nil error if both subscription and check are empty strings.
func SortCheckConfigsByName ¶
func SortCheckConfigsByName(es []*CheckConfig, asc bool) sort.Interface
SortCheckConfigsByName can be used to sort a given collection of checks by their names.
func SortCheckConfigsByPredicate ¶
func SortCheckConfigsByPredicate(cs []*CheckConfig, fn cmpCheckConfig) sort.Interface
SortCheckConfigsByPredicate can be used to sort a given collection using a given predicate.
func SortEntitiesByID ¶
SortEntitiesByID can be used to sort a given collection of entities by their IDs.
func SortEntitiesByLastSeen ¶
SortEntitiesByLastSeen can be used to sort a given collection of entities by last time each was seen.
func SortEntitiesByPredicate ¶
SortEntitiesByPredicate can be used to sort a given collection using a given predicate.
func ValidateAssetName ¶
ValidateAssetName validates that asset's name is valid
func ValidateEnvVars ¶
ValidateEnvVars ensures that all the environment variables are well-formed. Vars should be of the form FOO=BAR.
func ValidateName ¶
ValidateName validates the name of an element so it's not empty and it does not contains specical characters. Compatible with Sensu 1.0.
func ValidateNameStrict ¶
ValidateNameStrict validates the name of an element so it's not empty and it does not contains specical characters. Not compatible with Sensu 1.0 resources.
func ValidateOutputMetricFormat ¶
ValidateOutputMetricFormat returns an error if the string is not a valid metric format
func ValidateSubscriptionName ¶
ValidateSubscriptionName validates the name of a subscription so it's not empty and it does not contains special characters except for an optional ":"
Types ¶
type AdhocRequest ¶
type AdhocRequest struct {
// Name is the name of the requested adhoc check.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"check"`
// Subscriptions is the list of entity subscriptions.
Subscriptions []string `protobuf:"bytes,2,rep,name=subscriptions" json:"subscriptions,omitempty"`
// Creator is the author of the adhoc request.
Creator string `protobuf:"bytes,3,opt,name=creator,proto3" json:"creator,omitempty"`
// Reason is used to provide context to the request.
Reason string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"`
}
func FixtureAdhocRequest ¶
func FixtureAdhocRequest(name string, subscriptions []string) *AdhocRequest
FixtureAdhocRequest returns a testing fixture for an AdhocRequest struct.
func NewPopulatedAdhocRequest ¶
func NewPopulatedAdhocRequest(r randyAdhoc, easy bool) *AdhocRequest
func (*AdhocRequest) Descriptor ¶
func (*AdhocRequest) Descriptor() ([]byte, []int)
func (*AdhocRequest) Equal ¶
func (this *AdhocRequest) Equal(that interface{}) bool
func (*AdhocRequest) GetCreator ¶
func (m *AdhocRequest) GetCreator() string
func (*AdhocRequest) GetName ¶
func (m *AdhocRequest) GetName() string
func (*AdhocRequest) GetReason ¶
func (m *AdhocRequest) GetReason() string
func (*AdhocRequest) GetSubscriptions ¶
func (m *AdhocRequest) GetSubscriptions() []string
func (*AdhocRequest) Marshal ¶
func (m *AdhocRequest) Marshal() (dAtA []byte, err error)
func (*AdhocRequest) ProtoMessage ¶
func (*AdhocRequest) ProtoMessage()
func (*AdhocRequest) Reset ¶
func (m *AdhocRequest) Reset()
func (*AdhocRequest) Size ¶
func (m *AdhocRequest) Size() (n int)
func (*AdhocRequest) String ¶
func (m *AdhocRequest) String() string
func (*AdhocRequest) URIPath ¶
func (a *AdhocRequest) URIPath() string
URIPath is the URI path component to the adhoc request.
func (*AdhocRequest) Unmarshal ¶
func (m *AdhocRequest) Unmarshal(dAtA []byte) error
func (*AdhocRequest) Validate ¶
func (a *AdhocRequest) Validate() error
Validate returns an error if the name is not provided.
type AgentHandshake ¶
type AgentHandshake Entity
An AgentHandshake is the first message sent by a Backend on a Transport in a Session.
type Any ¶
type Any struct {
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func NewPopulatedAny ¶
func (*Any) Descriptor ¶
func (*Any) GetTypeUrl ¶
func (*Any) ProtoMessage ¶
func (*Any) ProtoMessage()
type Asset ¶
type Asset struct {
// Name is the unique identifier for an asset
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// URL is the location of the asset
URL string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
// Sha512 is the SHA-512 checksum of the asset
Sha512 string `protobuf:"bytes,3,opt,name=sha512,proto3" json:"sha512,omitempty"`
// Metadata is a set of key value pair associated with the asset
Metadata map[string]string `` /* 140-byte string literal not displayed */
// Filters are a collection of sensu queries, used by the system to determine
// if the asset should be installed. If more than one filter is present the
// queries are joined by the "AND" operator.
Filters []string `protobuf:"bytes,5,rep,name=filters" json:"filters"`
// Organization indicates to which org an asset belongs to
Organization string `protobuf:"bytes,6,opt,name=organization,proto3" json:"organization,omitempty"`
}
Asset defines an asset agents install as a dependency for a check.
func FixtureAsset ¶
FixtureAsset given a name returns a valid asset for use in tests
func NewPopulatedAsset ¶
func (*Asset) Descriptor ¶
func (*Asset) GetEnvironment ¶
GetEnvironment refers to the organization the check belongs to
func (*Asset) GetFilters ¶
func (*Asset) GetMetadata ¶
func (*Asset) GetOrganization ¶
func (*Asset) ProtoMessage ¶
func (*Asset) ProtoMessage()
type BackendHandshake ¶
type BackendHandshake struct{}
A BackendHandshake is the first message sent by a Backend on a Transport in a Session.
type ByExecuted ¶
type ByExecuted []CheckHistory
ByExecuted implements the sort.Interface for []CheckHistory based on the Executed field.
Example:
sort.Sort(ByExecuted(check.History))
func (ByExecuted) Len ¶
func (b ByExecuted) Len() int
func (ByExecuted) Less ¶
func (b ByExecuted) Less(i, j int) bool
func (ByExecuted) Swap ¶
func (b ByExecuted) Swap(i, j int)
type Check ¶
type Check struct {
// Command is the command to be executed.
Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
// Environment indicates to which env a check belongs to
Environment string `protobuf:"bytes,2,opt,name=environment,proto3" json:"environment,omitempty"`
// Handlers are the event handler for the check (incidents and/or metrics).
Handlers []string `protobuf:"bytes,3,rep,name=handlers" json:"handlers"`
// HighFlapThreshold is the flap detection high threshold (% state change) for
// the check. Sensu uses the same flap detection algorithm as Nagios.
HighFlapThreshold uint32 `protobuf:"varint,4,opt,name=high_flap_threshold,json=highFlapThreshold,proto3" json:"high_flap_threshold"`
// Interval is the interval, in seconds, at which the check should be run.
Interval uint32 `protobuf:"varint,5,opt,name=interval,proto3" json:"interval"`
// LowFlapThreshold is the flap detection low threshold (% state change) for
// the check. Sensu uses the same flap detection algorithm as Nagios.
LowFlapThreshold uint32 `protobuf:"varint,6,opt,name=low_flap_threshold,json=lowFlapThreshold,proto3" json:"low_flap_threshold"`
// Name is the unique identifier for a check.
Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`
// Organization indicates to which org a check belongs to
Organization string `protobuf:"bytes,8,opt,name=organization,proto3" json:"organization,omitempty"`
// Publish indicates if check requests are published for the check
Publish bool `protobuf:"varint,9,opt,name=publish,proto3" json:"publish"`
// RuntimeAssets are a list of assets required to execute check.
RuntimeAssets []string `protobuf:"bytes,10,rep,name=runtime_assets,json=runtimeAssets" json:"runtime_assets"`
// Subscriptions is the list of subscribers for the check.
Subscriptions []string `protobuf:"bytes,11,rep,name=subscriptions" json:"subscriptions"`
// Sources indicates the name of the entity representing an external resource
ProxyEntityID string `protobuf:"bytes,13,opt,name=proxy_entity_id,json=proxyEntityId,proto3" json:"proxy_entity_id"`
// CheckHooks is the list of check hooks for the check
CheckHooks []HookList `protobuf:"bytes,14,rep,name=check_hooks,json=checkHooks" json:"check_hooks"`
// STDIN indicates if the check command accepts JSON via stdin from the agent
Stdin bool `protobuf:"varint,15,opt,name=stdin,proto3" json:"stdin"`
// Subdue represents one or more time windows when the check should be subdued.
Subdue *TimeWindowWhen `protobuf:"bytes,16,opt,name=subdue" json:"subdue"`
// Cron is the cron string at which the check should be run.
Cron string `protobuf:"bytes,17,opt,name=cron,proto3" json:"cron,omitempty"`
// TTL represents the length of time in seconds for which a check result is valid.
Ttl int64 `protobuf:"varint,18,opt,name=ttl,proto3" json:"ttl"`
// Timeout is the timeout, in seconds, at which the check has to run
Timeout uint32 `protobuf:"varint,19,opt,name=timeout,proto3" json:"timeout"`
// ProxyRequests represents a request to execute a proxy check
ProxyRequests *ProxyRequests `protobuf:"bytes,20,opt,name=proxy_requests,json=proxyRequests" json:"proxy_requests,omitempty"`
// RoundRobin enables round-robin scheduling if set true.
RoundRobin bool `protobuf:"varint,21,opt,name=round_robin,json=roundRobin,proto3" json:"round_robin"`
// Duration of execution
Duration float64 `protobuf:"fixed64,22,opt,name=duration,proto3" json:"duration,omitempty"`
// Executed describes the time in which the check request was executed
Executed int64 `protobuf:"varint,23,opt,name=executed,proto3" json:"executed"`
// History is the check state history.
History []CheckHistory `protobuf:"bytes,24,rep,name=history" json:"history"`
// Issued describes the time in which the check request was issued
Issued int64 `protobuf:"varint,25,opt,name=issued,proto3" json:"issued"`
// Output from the execution of Command
Output string `protobuf:"bytes,26,opt,name=output,proto3" json:"output,omitempty"`
// State provides handlers with more information about the state change
State string `protobuf:"bytes,27,opt,name=state,proto3" json:"state,omitempty"`
// Status is the exit status code produced by the check
Status uint32 `protobuf:"varint,28,opt,name=status,proto3" json:"status"`
// TotalStateChange indicates the total state change percentage for the
// check's history
TotalStateChange uint32 `protobuf:"varint,29,opt,name=total_state_change,json=totalStateChange,proto3" json:"total_state-change"`
// LastOK displays last time this check was ok; if event status is 0 this is set to timestamp
LastOK int64 `protobuf:"varint,30,opt,name=last_ok,json=lastOk,proto3" json:"last_ok"`
// Occurrences indicates the number of times an event has occurred for a client/check pair with the same check status
Occurrences int64 `protobuf:"varint,31,opt,name=occurrences,proto3" json:"occurrences"`
// OccurrencesWatermark indicates the high water mark tracking number of occurrences at the current severity
OccurrencesWatermark int64 `protobuf:"varint,32,opt,name=occurrences_watermark,json=occurrencesWatermark,proto3" json:"occurrences_watermark"`
// Silenced is a list of silenced entry ids (subscription and check name)
Silenced []string `protobuf:"bytes,33,rep,name=silenced" json:"silenced,omitempty"`
// Hooks describes the results of multiple hooks; if event is associated to hook execution.
Hooks []*Hook `protobuf:"bytes,34,rep,name=hooks" json:"hooks,omitempty"`
// OutputOutputMetricFormat is the metric protocol that the check's output will be
// expected to follow in order to be extracted.
OutputMetricFormat string `protobuf:"bytes,35,opt,name=output_metric_format,json=outputMetricFormat,proto3" json:"output_metric_format"`
// OutputOutputMetricHandlers is the list of event handlers that will respond to metrics
// that have been extracted from the check.
OutputMetricHandlers []string `protobuf:"bytes,36,rep,name=output_metric_handlers,json=outputMetricHandlers" json:"output_metric_handlers"`
// EnvVars is the list of environment variables to set for the check's
// execution environment.
EnvVars []string `protobuf:"bytes,37,rep,name=env_vars,json=envVars" json:"env_vars"`
// ExtendedAttributes store serialized arbitrary JSON-encoded data
ExtendedAttributes []byte `protobuf:"bytes,99,opt,name=ExtendedAttributes,proto3" json:"-"`
}
A Check is a check specification and optionally the results of the check's execution.
func FixtureCheck ¶
FixtureCheck returns a fixture for a Check object.
func NewCheck ¶
func NewCheck(c *CheckConfig) *Check
NewCheck creates a new Check. It copies the fields from CheckConfig that match with Check's fields.
Because CheckConfig uses extended attributes, embedding CheckConfig was deemed to be too complicated, due to interactions between promoted methods and encoding/json.
func NewPopulatedCheck ¶
func (*Check) Descriptor ¶
func (*Check) GetCheckHooks ¶
func (*Check) GetCommand ¶
func (*Check) GetDuration ¶
func (*Check) GetEnvVars ¶
func (*Check) GetEnvironment ¶
func (*Check) GetExecuted ¶
func (*Check) GetExtendedAttributes ¶
func (*Check) GetHandlers ¶
func (*Check) GetHighFlapThreshold ¶
func (*Check) GetHistory ¶
func (m *Check) GetHistory() []CheckHistory
func (*Check) GetInterval ¶
func (*Check) GetLowFlapThreshold ¶
func (*Check) GetOccurrences ¶
func (*Check) GetOccurrencesWatermark ¶
func (*Check) GetOrganization ¶
func (*Check) GetOutputMetricFormat ¶
func (*Check) GetOutputMetricHandlers ¶
func (*Check) GetProxyEntityID ¶
func (*Check) GetProxyRequests ¶
func (m *Check) GetProxyRequests() *ProxyRequests
func (*Check) GetPublish ¶
func (*Check) GetRoundRobin ¶
func (*Check) GetRuntimeAssets ¶
func (*Check) GetSilenced ¶
func (*Check) GetSubdue ¶
func (m *Check) GetSubdue() *TimeWindowWhen
func (*Check) GetSubscriptions ¶
func (*Check) GetTimeout ¶
func (*Check) GetTotalStateChange ¶
func (*Check) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Check) MergeWith ¶
MergeWith updates the current Check with the history of the check given as an argument, updating the current check's history appropriately.
func (*Check) ProtoMessage ¶
func (*Check) ProtoMessage()
func (*Check) SetExtendedAttributes ¶
SetExtendedAttributes sets the serialized ExtendedAttributes of c.
func (*Check) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type CheckConfig ¶
type CheckConfig struct {
// Command is the command to be executed.
Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
// Environment indicates to which env a check belongs to
Environment string `protobuf:"bytes,2,opt,name=environment,proto3" json:"environment,omitempty"`
// Handlers are the event handler for the check (incidents and/or metrics).
Handlers []string `protobuf:"bytes,3,rep,name=handlers" json:"handlers"`
// HighFlapThreshold is the flap detection high threshold (% state change) for
// the check. Sensu uses the same flap detection algorithm as Nagios.
HighFlapThreshold uint32 `protobuf:"varint,4,opt,name=high_flap_threshold,json=highFlapThreshold,proto3" json:"high_flap_threshold"`
// Interval is the interval, in seconds, at which the check should be run.
Interval uint32 `protobuf:"varint,5,opt,name=interval,proto3" json:"interval"`
// LowFlapThreshold is the flap detection low threshold (% state change) for
// the check. Sensu uses the same flap detection algorithm as Nagios.
LowFlapThreshold uint32 `protobuf:"varint,6,opt,name=low_flap_threshold,json=lowFlapThreshold,proto3" json:"low_flap_threshold"`
// Name is the unique identifier for a check.
Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`
// Organization indicates to which org a check belongs to
Organization string `protobuf:"bytes,8,opt,name=organization,proto3" json:"organization,omitempty"`
// Publish indicates if check requests are published for the check
Publish bool `protobuf:"varint,9,opt,name=publish,proto3" json:"publish"`
// RuntimeAssets are a list of assets required to execute check.
RuntimeAssets []string `protobuf:"bytes,10,rep,name=runtime_assets,json=runtimeAssets" json:"runtime_assets"`
// Subscriptions is the list of subscribers for the check.
Subscriptions []string `protobuf:"bytes,11,rep,name=subscriptions" json:"subscriptions"`
// ExtendedAttributes store serialized arbitrary JSON-encoded data
ExtendedAttributes []byte `protobuf:"bytes,12,opt,name=ExtendedAttributes,proto3" json:"-"`
// Sources indicates the name of the entity representing an external resource
ProxyEntityID string `protobuf:"bytes,13,opt,name=proxy_entity_id,json=proxyEntityId,proto3" json:"proxy_entity_id"`
// CheckHooks is the list of check hooks for the check
CheckHooks []HookList `protobuf:"bytes,14,rep,name=check_hooks,json=checkHooks" json:"check_hooks"`
// STDIN indicates if the check command accepts JSON via stdin from the agent
Stdin bool `protobuf:"varint,15,opt,name=stdin,proto3" json:"stdin"`
// Subdue represents one or more time windows when the check should be subdued.
Subdue *TimeWindowWhen `protobuf:"bytes,16,opt,name=subdue" json:"subdue"`
// Cron is the cron string at which the check should be run.
Cron string `protobuf:"bytes,17,opt,name=cron,proto3" json:"cron,omitempty"`
// TTL represents the length of time in seconds for which a check result is valid.
Ttl int64 `protobuf:"varint,18,opt,name=ttl,proto3" json:"ttl"`
// Timeout is the timeout, in seconds, at which the check has to run
Timeout uint32 `protobuf:"varint,19,opt,name=timeout,proto3" json:"timeout"`
// ProxyRequests represents a request to execute a proxy check
ProxyRequests *ProxyRequests `protobuf:"bytes,20,opt,name=proxy_requests,json=proxyRequests" json:"proxy_requests,omitempty"`
// RoundRobin enables round-robin scheduling if set true.
RoundRobin bool `protobuf:"varint,21,opt,name=round_robin,json=roundRobin,proto3" json:"round_robin"`
// OutputOutputMetricFormat is the metric protocol that the check's output will be
// expected to follow in order to be extracted.
OutputMetricFormat string `protobuf:"bytes,22,opt,name=output_metric_format,json=outputMetricFormat,proto3" json:"output_metric_format"`
// OutputOutputMetricHandlers is the list of event handlers that will respond to metrics
// that have been extracted from the check.
OutputMetricHandlers []string `protobuf:"bytes,23,rep,name=output_metric_handlers,json=outputMetricHandlers" json:"output_metric_handlers"`
// EnvVars is the list of environment variables to set for the check's
// execution environment.
EnvVars []string `protobuf:"bytes,24,rep,name=env_vars,json=envVars" json:"env_vars"`
}
CheckConfig is the specification of a check.
func FixtureCheckConfig ¶
func FixtureCheckConfig(id string) *CheckConfig
FixtureCheckConfig returns a fixture for a CheckConfig object.
func NewPopulatedCheckConfig ¶
func NewPopulatedCheckConfig(r randyCheck, easy bool) *CheckConfig
func (*CheckConfig) Descriptor ¶
func (*CheckConfig) Descriptor() ([]byte, []int)
func (*CheckConfig) Equal ¶
func (this *CheckConfig) Equal(that interface{}) bool
func (*CheckConfig) Get ¶
func (c *CheckConfig) Get(name string) (interface{}, error)
Get implements govaluate.Parameters
func (*CheckConfig) GetCheckHooks ¶
func (m *CheckConfig) GetCheckHooks() []HookList
func (*CheckConfig) GetCommand ¶
func (m *CheckConfig) GetCommand() string
func (*CheckConfig) GetCron ¶
func (m *CheckConfig) GetCron() string
func (*CheckConfig) GetEnvVars ¶
func (m *CheckConfig) GetEnvVars() []string
func (*CheckConfig) GetEnvironment ¶
func (m *CheckConfig) GetEnvironment() string
func (*CheckConfig) GetExtendedAttributes ¶
func (m *CheckConfig) GetExtendedAttributes() []byte
func (*CheckConfig) GetHandlers ¶
func (m *CheckConfig) GetHandlers() []string
func (*CheckConfig) GetHighFlapThreshold ¶
func (m *CheckConfig) GetHighFlapThreshold() uint32
func (*CheckConfig) GetInterval ¶
func (m *CheckConfig) GetInterval() uint32
func (*CheckConfig) GetLowFlapThreshold ¶
func (m *CheckConfig) GetLowFlapThreshold() uint32
func (*CheckConfig) GetName ¶
func (m *CheckConfig) GetName() string
func (*CheckConfig) GetOrganization ¶
func (m *CheckConfig) GetOrganization() string
func (*CheckConfig) GetOutputMetricFormat ¶
func (m *CheckConfig) GetOutputMetricFormat() string
func (*CheckConfig) GetOutputMetricHandlers ¶
func (m *CheckConfig) GetOutputMetricHandlers() []string
func (*CheckConfig) GetProxyEntityID ¶
func (m *CheckConfig) GetProxyEntityID() string
func (*CheckConfig) GetProxyRequests ¶
func (m *CheckConfig) GetProxyRequests() *ProxyRequests
func (*CheckConfig) GetPublish ¶
func (m *CheckConfig) GetPublish() bool
func (*CheckConfig) GetRoundRobin ¶
func (m *CheckConfig) GetRoundRobin() bool
func (*CheckConfig) GetRuntimeAssets ¶
func (m *CheckConfig) GetRuntimeAssets() []string
func (*CheckConfig) GetStdin ¶
func (m *CheckConfig) GetStdin() bool
func (*CheckConfig) GetSubdue ¶
func (m *CheckConfig) GetSubdue() *TimeWindowWhen
func (*CheckConfig) GetSubscriptions ¶
func (m *CheckConfig) GetSubscriptions() []string
func (*CheckConfig) GetTimeout ¶
func (m *CheckConfig) GetTimeout() uint32
func (*CheckConfig) GetTtl ¶
func (m *CheckConfig) GetTtl() int64
func (*CheckConfig) IsSubdued ¶
func (c *CheckConfig) IsSubdued() bool
IsSubdued returns true if the check is subdued at the current time. It returns false otherwise.
func (*CheckConfig) Marshal ¶
func (m *CheckConfig) Marshal() (dAtA []byte, err error)
func (*CheckConfig) MarshalJSON ¶
func (c *CheckConfig) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*CheckConfig) ProtoMessage ¶
func (*CheckConfig) ProtoMessage()
func (*CheckConfig) Reset ¶
func (m *CheckConfig) Reset()
func (*CheckConfig) SetExtendedAttributes ¶
func (c *CheckConfig) SetExtendedAttributes(e []byte)
SetExtendedAttributes sets the serialized ExtendedAttributes of c.
func (*CheckConfig) Size ¶
func (m *CheckConfig) Size() (n int)
func (*CheckConfig) String ¶
func (m *CheckConfig) String() string
func (*CheckConfig) URIPath ¶
func (c *CheckConfig) URIPath() string
URIPath returns the path component of a CheckConfig URI.
func (*CheckConfig) Unmarshal ¶
func (m *CheckConfig) Unmarshal(dAtA []byte) error
func (*CheckConfig) UnmarshalJSON ¶
func (c *CheckConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
func (*CheckConfig) Validate ¶
func (c *CheckConfig) Validate() error
Validate returns an error if the check does not pass validation tests.
type CheckHistory ¶
type CheckHistory struct {
// Status is the exit status code produced by the check.
Status uint32 `protobuf:"varint,1,opt,name=status,proto3" json:"status"`
// Executed describes the time in which the check request was executed
Executed int64 `protobuf:"varint,2,opt,name=executed,proto3" json:"executed"`
}
CheckHistory is a record of a check execution and its status
func NewPopulatedCheckHistory ¶
func NewPopulatedCheckHistory(r randyCheck, easy bool) *CheckHistory
func (*CheckHistory) Descriptor ¶
func (*CheckHistory) Descriptor() ([]byte, []int)
func (*CheckHistory) Equal ¶
func (this *CheckHistory) Equal(that interface{}) bool
func (*CheckHistory) GetExecuted ¶
func (m *CheckHistory) GetExecuted() int64
func (*CheckHistory) GetStatus ¶
func (m *CheckHistory) GetStatus() uint32
func (*CheckHistory) Marshal ¶
func (m *CheckHistory) Marshal() (dAtA []byte, err error)
func (*CheckHistory) ProtoMessage ¶
func (*CheckHistory) ProtoMessage()
func (*CheckHistory) Reset ¶
func (m *CheckHistory) Reset()
func (*CheckHistory) Size ¶
func (m *CheckHistory) Size() (n int)
func (*CheckHistory) String ¶
func (m *CheckHistory) String() string
func (*CheckHistory) Unmarshal ¶
func (m *CheckHistory) Unmarshal(dAtA []byte) error
type CheckRequest ¶
type CheckRequest struct {
// Config is the specification of a check.
Config *CheckConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"`
// Assets are a list of assets required to execute check.
Assets []Asset `protobuf:"bytes,2,rep,name=assets" json:"assets"`
// Hooks are a list of hooks to be executed after a check.
Hooks []HookConfig `protobuf:"bytes,3,rep,name=hooks" json:"hooks"`
// Issued describes the time in which the check request was issued
Issued int64 `protobuf:"varint,4,opt,name=Issued,proto3" json:"issued"`
}
A CheckRequest represents a request to execute a check
func FixtureCheckRequest ¶
func FixtureCheckRequest(id string) *CheckRequest
FixtureCheckRequest returns a fixture for a CheckRequest object.
func NewPopulatedCheckRequest ¶
func NewPopulatedCheckRequest(r randyCheck, easy bool) *CheckRequest
func (*CheckRequest) Descriptor ¶
func (*CheckRequest) Descriptor() ([]byte, []int)
func (*CheckRequest) Equal ¶
func (this *CheckRequest) Equal(that interface{}) bool
func (*CheckRequest) GetAssets ¶
func (m *CheckRequest) GetAssets() []Asset
func (*CheckRequest) GetConfig ¶
func (m *CheckRequest) GetConfig() *CheckConfig
func (*CheckRequest) GetHooks ¶
func (m *CheckRequest) GetHooks() []HookConfig
func (*CheckRequest) GetIssued ¶
func (m *CheckRequest) GetIssued() int64
func (*CheckRequest) Marshal ¶
func (m *CheckRequest) Marshal() (dAtA []byte, err error)
func (*CheckRequest) ProtoMessage ¶
func (*CheckRequest) ProtoMessage()
func (*CheckRequest) Reset ¶
func (m *CheckRequest) Reset()
func (*CheckRequest) Size ¶
func (m *CheckRequest) Size() (n int)
func (*CheckRequest) String ¶
func (m *CheckRequest) String() string
func (*CheckRequest) Unmarshal ¶
func (m *CheckRequest) Unmarshal(dAtA []byte) error
type ConstrainedResource ¶
type ConstrainedResource interface {
Validate() error
}
ConstrainedResource defines a resources that has contraints on it's attributes
type Deregistration ¶
type Deregistration struct {
Handler string `protobuf:"bytes,1,opt,name=handler,proto3" json:"handler,omitempty"`
}
Deregistration contains configuration for Sensu entity de-registration.
func NewPopulatedDeregistration ¶
func NewPopulatedDeregistration(r randyEntity, easy bool) *Deregistration
func (*Deregistration) Descriptor ¶
func (*Deregistration) Descriptor() ([]byte, []int)
func (*Deregistration) Equal ¶
func (this *Deregistration) Equal(that interface{}) bool
func (*Deregistration) GetHandler ¶
func (m *Deregistration) GetHandler() string
func (*Deregistration) Marshal ¶
func (m *Deregistration) Marshal() (dAtA []byte, err error)
func (*Deregistration) ProtoMessage ¶
func (*Deregistration) ProtoMessage()
func (*Deregistration) Reset ¶
func (m *Deregistration) Reset()
func (*Deregistration) Size ¶
func (m *Deregistration) Size() (n int)
func (*Deregistration) String ¶
func (m *Deregistration) String() string
func (*Deregistration) Unmarshal ¶
func (m *Deregistration) Unmarshal(dAtA []byte) error
type Entity ¶
type Entity struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Class string `protobuf:"bytes,2,opt,name=class,proto3" json:"class,omitempty"`
System System `protobuf:"bytes,3,opt,name=system" json:"system"`
Subscriptions []string `protobuf:"bytes,4,rep,name=subscriptions" json:"subscriptions"`
LastSeen int64 `protobuf:"varint,5,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen"`
Deregister bool `protobuf:"varint,6,opt,name=deregister,proto3" json:"deregister"`
Deregistration Deregistration `protobuf:"bytes,7,opt,name=deregistration" json:"deregistration"`
KeepaliveTimeout uint32 `protobuf:"varint,8,opt,name=keepalive_timeout,json=keepaliveTimeout,proto3" json:"keepalive_timeout"`
Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"`
Organization string `protobuf:"bytes,10,opt,name=organization,proto3" json:"organization,omitempty"`
User string `protobuf:"bytes,11,opt,name=user,proto3" json:"user,omitempty"`
// ExtendedAttributes store serialized arbitrary JSON-encoded data
ExtendedAttributes []byte `protobuf:"bytes,12,opt,name=extended_attributes,json=extendedAttributes,proto3" json:"-"`
// Redact contains the fields to redact on the agent
Redact []string `protobuf:"bytes,13,rep,name=redact" json:"redact,omitempty"`
}
Entity is the Entity supplying the event. The default Entity for any Event is the running Agent process--if the Event is sent by an Agent.
func FixtureEntity ¶
FixtureEntity returns a testing fixture for an Entity object.
func NewPopulatedEntity ¶
func (*Entity) Descriptor ¶
func (*Entity) GetDeregister ¶
func (*Entity) GetDeregistration ¶
func (m *Entity) GetDeregistration() Deregistration
func (*Entity) GetEnvironment ¶
func (*Entity) GetExtendedAttributes ¶
func (*Entity) GetKeepaliveTimeout ¶
func (*Entity) GetLastSeen ¶
func (*Entity) GetOrganization ¶
func (*Entity) GetSubscriptions ¶
func (*Entity) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Entity) ProtoMessage ¶
func (*Entity) ProtoMessage()
func (*Entity) SetExtendedAttributes ¶
SetExtendedAttributes sets the serialized ExtendedAttributes of the entity.
func (*Entity) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type Environment ¶
type Environment struct {
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Organization string `protobuf:"bytes,3,opt,name=organization,proto3" json:"organization,omitempty"`
}
Environment represents a Sensu environment in RBAC
func FixtureEnvironment ¶
func FixtureEnvironment(name string) *Environment
FixtureEnvironment returns a mocked environment.
func NewPopulatedEnvironment ¶
func NewPopulatedEnvironment(r randyEnvironment, easy bool) *Environment
func (*Environment) Descriptor ¶
func (*Environment) Descriptor() ([]byte, []int)
func (*Environment) Equal ¶
func (this *Environment) Equal(that interface{}) bool
func (*Environment) GetDescription ¶
func (m *Environment) GetDescription() string
func (*Environment) GetEnvironment ¶
func (e *Environment) GetEnvironment() string
GetEnvironment gets the Evironment that e belongs to (itself).
func (*Environment) GetName ¶
func (m *Environment) GetName() string
func (*Environment) GetOrganization ¶
func (m *Environment) GetOrganization() string
func (*Environment) Marshal ¶
func (m *Environment) Marshal() (dAtA []byte, err error)
func (*Environment) ProtoMessage ¶
func (*Environment) ProtoMessage()
func (*Environment) Reset ¶
func (m *Environment) Reset()
func (*Environment) Size ¶
func (m *Environment) Size() (n int)
func (*Environment) String ¶
func (m *Environment) String() string
func (*Environment) URIPath ¶
func (e *Environment) URIPath() string
URIPath returns the path component of a Environment URI.
func (*Environment) Unmarshal ¶
func (m *Environment) Unmarshal(dAtA []byte) error
func (*Environment) Update ¶
func (e *Environment) Update(from *Environment, fields ...string) error
Update updates an Environment with selected fields.
func (*Environment) Validate ¶
func (e *Environment) Validate() error
Validate returns an error if the environment does not pass validation tests.
type Error ¶
type Error struct {
// Name is the unique identifier for an asset.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Message is the details associated with the error.
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// Component refers to the component in-which the error occurred.
Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"`
// Timestamp refers to the instant in-which the error occurred.
Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp"`
// Event refers to the event that was being processed when the error occurred.
Event Event `protobuf:"bytes,5,opt,name=event" json:"event"`
}
Error describes an error captured while processing an event in Sensu's pipeline.
func FixtureError ¶
FixtureError returns a testing fixture for an Error object.
func NewPopulatedError ¶
func (*Error) Descriptor ¶
func (*Error) GetComponent ¶
func (*Error) GetEnvironment ¶
GetEnvironment returns the environmen the entity is associated with.
func (*Error) GetMessage ¶
func (*Error) GetOrganization ¶
GetOrganization returns the organization the entity is associated with.
func (*Error) GetTimestamp ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
type Event ¶
type Event struct {
// Timestamp is the time in seconds since the Epoch.
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// Entity describes the entity in which the event occurred.
Entity *Entity `protobuf:"bytes,2,opt,name=entity" json:"entity,omitempty"`
// Check describes the result of a check; if event is associated to check execution.
Check *Check `protobuf:"bytes,3,opt,name=check" json:"check,omitempty"`
// Metrics ...
Metrics *Metrics `protobuf:"bytes,4,opt,name=metrics" json:"metrics,omitempty"`
// Silenced is a list of silenced entry ids (subscription and check name)
Silenced []string `protobuf:"bytes,5,rep,name=silenced" json:"silenced,omitempty"`
// Hooks describes the results of multiple hooks; if event is associated to hook execution.
Hooks []*Hook `protobuf:"bytes,6,rep,name=hooks" json:"hooks,omitempty"`
}
An Event is the encapsulating type sent across the Sensu websocket transport.
func FixtureEvent ¶
FixtureEvent returns a testing fixutre for an Event object.
func NewPopulatedEvent ¶
func (*Event) Descriptor ¶
func (*Event) GetMetrics ¶
func (*Event) GetSilenced ¶
func (*Event) GetTimestamp ¶
func (*Event) HasMetrics ¶
HasMetrics determines if an event has metric data.
func (*Event) IsIncident ¶
IsIncident determines if an event indicates an incident.
func (*Event) IsResolution ¶
IsResolution returns true if an event has just transitionned from an incident
func (*Event) IsSilenced ¶
IsSilenced determines if an event has any silenced entries
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
type EventFilter ¶
type EventFilter struct {
// Name is the unique identifier for a filter
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Action specifies to allow/deny events to continue through the pipeline
Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
// Statements is an array of boolean expressions that are &&'d together
// to determine if the event matches this filter.
Statements []string `protobuf:"bytes,3,rep,name=statements" json:"statements"`
// Environment indicates to which env a filter belongs to
Environment string `protobuf:"bytes,4,opt,name=environment,proto3" json:"environment,omitempty"`
// Organization indicates to which org a filter belongs to
Organization string `protobuf:"bytes,5,opt,name=organization,proto3" json:"organization,omitempty"`
// When indicates a TimeWindowWhen that a filter uses to filter by days & times
When *TimeWindowWhen `protobuf:"bytes,6,opt,name=when" json:"when,omitempty"`
}
EventFilter is a filter specification.
func FixtureDenyEventFilter ¶
func FixtureDenyEventFilter(name string) *EventFilter
FixtureDenyEventFilter returns a Filter fixture for testing.
func FixtureEventFilter ¶
func FixtureEventFilter(name string) *EventFilter
FixtureEventFilter returns a Filter fixture for testing.
func NewPopulatedEventFilter ¶
func NewPopulatedEventFilter(r randyFilter, easy bool) *EventFilter
func (*EventFilter) Descriptor ¶
func (*EventFilter) Descriptor() ([]byte, []int)
func (*EventFilter) Equal ¶
func (this *EventFilter) Equal(that interface{}) bool
func (*EventFilter) GetAction ¶
func (m *EventFilter) GetAction() string
func (*EventFilter) GetEnvironment ¶
func (m *EventFilter) GetEnvironment() string
func (*EventFilter) GetName ¶
func (m *EventFilter) GetName() string
func (*EventFilter) GetOrganization ¶
func (m *EventFilter) GetOrganization() string
func (*EventFilter) GetStatements ¶
func (m *EventFilter) GetStatements() []string
func (*EventFilter) GetWhen ¶
func (m *EventFilter) GetWhen() *TimeWindowWhen
func (*EventFilter) Marshal ¶
func (m *EventFilter) Marshal() (dAtA []byte, err error)
func (*EventFilter) ProtoMessage ¶
func (*EventFilter) ProtoMessage()
func (*EventFilter) Reset ¶
func (m *EventFilter) Reset()
func (*EventFilter) Size ¶
func (m *EventFilter) Size() (n int)
func (*EventFilter) String ¶
func (m *EventFilter) String() string
func (*EventFilter) URIPath ¶
func (f *EventFilter) URIPath() string
URIPath returns the path component of a Filter URI.
func (*EventFilter) Unmarshal ¶
func (m *EventFilter) Unmarshal(dAtA []byte) error
func (*EventFilter) Update ¶
func (f *EventFilter) Update(from *EventFilter, fields ...string) error
Update updates e with selected fields. Returns non-nil error if any of the selected fields are unsupported.
func (*EventFilter) Validate ¶
func (f *EventFilter) Validate() error
Validate returns an error if the filter does not pass validation tests.
type Extension ¶
type Extension struct {
// Name is the unique identifier for an extension.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// URL is the URL of the gRPC service that implements the extension.
URL string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
// Organization indicates which organization an extension belongs to.
Organization string `protobuf:"bytes,3,opt,name=organization,proto3" json:"organization,omitempty"`
}
Extension is a registered sensu extension.
func FixtureExtension ¶
FixtureExtension given a name returns a valid extension for use in tests
func NewPopulatedExtension ¶
func (*Extension) Descriptor ¶
func (*Extension) GetEnvironment ¶
GetEnvironment gets the environment for the extension. For extensions, the environment is always '*'.
func (*Extension) GetOrganization ¶
func (*Extension) ProtoMessage ¶
func (*Extension) ProtoMessage()
type Handler ¶
type Handler struct {
// Name is the unique identifier for a handler.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Type is the handler type, i.e. pipe.
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
// Mutator is the handler event data mutator.
Mutator string `protobuf:"bytes,3,opt,name=mutator,proto3" json:"mutator,omitempty"`
// Command is the command to be executed for a pipe handler.
Command string `protobuf:"bytes,4,opt,name=command,proto3" json:"command,omitempty"`
// Timeout is the handler timeout in seconds.
Timeout uint32 `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout"`
// Socket contains configuration for a TCP or UDP handler.
Socket *HandlerSocket `protobuf:"bytes,6,opt,name=socket" json:"socket,omitempty"`
// Handlers is a list of handlers for a handler set.
Handlers []string `protobuf:"bytes,7,rep,name=handlers" json:"handlers"`
// Filters is a list of filters name to evaluate before executing this handler
Filters []string `protobuf:"bytes,8,rep,name=filters" json:"filters"`
// EnvVars is a list of environment variables to use with command execution
EnvVars []string `protobuf:"bytes,9,rep,name=env_vars,json=envVars" json:"env_vars"`
// Environment indicates to which env a handler belongs to
Environment string `protobuf:"bytes,10,opt,name=environment,proto3" json:"environment,omitempty"`
// Organization indicates to which org a handler belongs to
Organization string `protobuf:"bytes,11,opt,name=organization,proto3" json:"organization,omitempty"`
}
A Handler is a handler specification.
func FakeHandlerCommand ¶
FakeHandlerCommand takes a command and (optionally) command args and will execute the TestHelperHandlerProcess test within the package FakeHandlerCommand is called from.
func FixtureHandler ¶
FixtureHandler returns a Handler fixture for testing.
func FixtureSetHandler ¶
FixtureSetHandler returns a Handler fixture for testing.
func FixtureSocketHandler ¶
FixtureSocketHandler returns a Handler fixture for testing.
func NewPopulatedHandler ¶
func (*Handler) Descriptor ¶
func (*Handler) GetCommand ¶
func (*Handler) GetEnvVars ¶
func (*Handler) GetEnvironment ¶
func (*Handler) GetFilters ¶
func (*Handler) GetHandlers ¶
func (*Handler) GetMutator ¶
func (*Handler) GetOrganization ¶
func (*Handler) GetSocket ¶
func (m *Handler) GetSocket() *HandlerSocket
func (*Handler) GetTimeout ¶
func (*Handler) ProtoMessage ¶
func (*Handler) ProtoMessage()
type HandlerSocket ¶
type HandlerSocket struct {
// Host is the socket peer address.
Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
// Port is the socket peer port.
Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port"`
}
HandlerSocket contains configuration for a TCP or UDP handler.
func NewPopulatedHandlerSocket ¶
func NewPopulatedHandlerSocket(r randyHandler, easy bool) *HandlerSocket
func (*HandlerSocket) Descriptor ¶
func (*HandlerSocket) Descriptor() ([]byte, []int)
func (*HandlerSocket) Equal ¶
func (this *HandlerSocket) Equal(that interface{}) bool
func (*HandlerSocket) GetHost ¶
func (m *HandlerSocket) GetHost() string
func (*HandlerSocket) GetPort ¶
func (m *HandlerSocket) GetPort() uint32
func (*HandlerSocket) Marshal ¶
func (m *HandlerSocket) Marshal() (dAtA []byte, err error)
func (*HandlerSocket) ProtoMessage ¶
func (*HandlerSocket) ProtoMessage()
func (*HandlerSocket) Reset ¶
func (m *HandlerSocket) Reset()
func (*HandlerSocket) Size ¶
func (m *HandlerSocket) Size() (n int)
func (*HandlerSocket) String ¶
func (m *HandlerSocket) String() string
func (*HandlerSocket) Unmarshal ¶
func (m *HandlerSocket) Unmarshal(dAtA []byte) error
func (*HandlerSocket) Validate ¶
func (s *HandlerSocket) Validate() error
type Hook ¶
type Hook struct {
// Config is the specification of a hook
HookConfig `protobuf:"bytes,1,opt,name=config,embedded=config" json:""`
// Duration of execution
Duration float64 `protobuf:"fixed64,2,opt,name=duration,proto3" json:"duration,omitempty"`
// Executed describes the time in which the hook request was executed
Executed int64 `protobuf:"varint,3,opt,name=executed,proto3" json:"executed"`
// Issued describes the time in which the hook request was issued
Issued int64 `protobuf:"varint,4,opt,name=issued,proto3" json:"issued"`
// Output from the execution of Command
Output string `protobuf:"bytes,5,opt,name=output,proto3" json:"output,omitempty"`
// Status is the exit status code produced by the hook
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status"`
}
A Hook is a hook specification and optionally the results of the hook's execution.
func FixtureHook ¶
FixtureHook returns a fixture for a Hook object.
func NewPopulatedHook ¶
func (*Hook) Descriptor ¶
func (*Hook) GetDuration ¶
func (*Hook) GetExecuted ¶
func (*Hook) ProtoMessage ¶
func (*Hook) ProtoMessage()
type HookConfig ¶
type HookConfig struct {
// Name is the unique identifier for a hook
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Command is the command to be executed
Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
// Timeout is the timeout, in seconds, at which the hook has to run
Timeout uint32 `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout"`
// Stdin indicates if hook requests have stdin enabled
Stdin bool `protobuf:"varint,4,opt,name=stdin,proto3" json:"stdin"`
// Environment indicates to which env a hook belongs to
Environment string `protobuf:"bytes,5,opt,name=environment,proto3" json:"environment,omitempty"`
// Organization indicates to which org a hook belongs to
Organization string `protobuf:"bytes,6,opt,name=organization,proto3" json:"organization,omitempty"`
}
HookConfig is the specification of a hook
func FixtureHookConfig ¶
func FixtureHookConfig(id string) *HookConfig
FixtureHookConfig returns a fixture for a HookConfig object.
func NewPopulatedHookConfig ¶
func NewPopulatedHookConfig(r randyHook, easy bool) *HookConfig
func (*HookConfig) Descriptor ¶
func (*HookConfig) Descriptor() ([]byte, []int)
func (*HookConfig) Equal ¶
func (this *HookConfig) Equal(that interface{}) bool
func (*HookConfig) GetCommand ¶
func (m *HookConfig) GetCommand() string
func (*HookConfig) GetEnvironment ¶
func (m *HookConfig) GetEnvironment() string
func (*HookConfig) GetName ¶
func (m *HookConfig) GetName() string
func (*HookConfig) GetOrganization ¶
func (m *HookConfig) GetOrganization() string
func (*HookConfig) GetStdin ¶
func (m *HookConfig) GetStdin() bool
func (*HookConfig) GetTimeout ¶
func (m *HookConfig) GetTimeout() uint32
func (*HookConfig) Marshal ¶
func (m *HookConfig) Marshal() (dAtA []byte, err error)
func (*HookConfig) ProtoMessage ¶
func (*HookConfig) ProtoMessage()
func (*HookConfig) Reset ¶
func (m *HookConfig) Reset()
func (*HookConfig) Size ¶
func (m *HookConfig) Size() (n int)
func (*HookConfig) String ¶
func (m *HookConfig) String() string
func (*HookConfig) URIPath ¶
func (c *HookConfig) URIPath() string
URIPath returns the path component of a HookConfig URI.
func (*HookConfig) Unmarshal ¶
func (m *HookConfig) Unmarshal(dAtA []byte) error
func (*HookConfig) Validate ¶
func (c *HookConfig) Validate() error
Validate returns an error if the hook does not pass validation tests.
type HookList ¶
type HookList struct {
// Hooks is the list of hooks for the check hook
Hooks []string `protobuf:"bytes,1,rep,name=hooks" json:"hooks"`
// Type indicates the type or response code for the check hook
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
}
func FixtureHookList ¶
FixtureHookList returns a fixture for a HookList object.
func NewPopulatedHookList ¶
func (*HookList) Descriptor ¶
func (*HookList) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*HookList) ProtoMessage ¶
func (*HookList) ProtoMessage()
func (*HookList) UnmarshalJSON ¶
UnmarshalJSON implements the json.Marshaler interface.
type KeepaliveRecord ¶
type KeepaliveRecord struct {
Environment string `protobuf:"bytes,1,opt,name=environment,proto3" json:"environment,omitempty"`
Organization string `protobuf:"bytes,2,opt,name=organization,proto3" json:"organization,omitempty"`
EntityID string `protobuf:"bytes,3,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"`
Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time"`
}
A KeepaliveRecord is a tuple of an Entity ID and the time at which the entity's keepalive will next expire.
func NewKeepaliveRecord ¶
func NewKeepaliveRecord(e *Entity, t int64) *KeepaliveRecord
NewKeepaliveRecord initializes and returns a KeepaliveRecord from an entity and its expiration time.
func NewPopulatedKeepaliveRecord ¶
func NewPopulatedKeepaliveRecord(r randyKeepalive, easy bool) *KeepaliveRecord
func (*KeepaliveRecord) Descriptor ¶
func (*KeepaliveRecord) Descriptor() ([]byte, []int)
func (*KeepaliveRecord) Equal ¶
func (this *KeepaliveRecord) Equal(that interface{}) bool
func (*KeepaliveRecord) GetEntityID ¶
func (m *KeepaliveRecord) GetEntityID() string
func (*KeepaliveRecord) GetEnvironment ¶
func (m *KeepaliveRecord) GetEnvironment() string
func (*KeepaliveRecord) GetOrganization ¶
func (m *KeepaliveRecord) GetOrganization() string
func (*KeepaliveRecord) GetTime ¶
func (m *KeepaliveRecord) GetTime() int64
func (*KeepaliveRecord) Marshal ¶
func (m *KeepaliveRecord) Marshal() (dAtA []byte, err error)
func (*KeepaliveRecord) ProtoMessage ¶
func (*KeepaliveRecord) ProtoMessage()
func (*KeepaliveRecord) Reset ¶
func (m *KeepaliveRecord) Reset()
func (*KeepaliveRecord) Size ¶
func (m *KeepaliveRecord) Size() (n int)
func (*KeepaliveRecord) String ¶
func (m *KeepaliveRecord) String() string
func (*KeepaliveRecord) Unmarshal ¶
func (m *KeepaliveRecord) Unmarshal(dAtA []byte) error
type MetricPoint ¶
type MetricPoint struct {
// The metric point name.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The metric point value.
Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value"`
// The metric point timestamp, time in nanoseconds since the Epoch.
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp"`
// Tags is a list of metric tags (dimensions).
Tags []*MetricTag `protobuf:"bytes,4,rep,name=tags" json:"tags"`
}
A MetricPoint represents a single measurement.
func FixtureMetricPoint ¶
func FixtureMetricPoint() *MetricPoint
FixtureMetricPoint returns a testing fixture for a Metric Point object.
func NewPopulatedMetricPoint ¶
func NewPopulatedMetricPoint(r randyMetrics, easy bool) *MetricPoint
func (*MetricPoint) Descriptor ¶
func (*MetricPoint) Descriptor() ([]byte, []int)
func (*MetricPoint) Equal ¶
func (this *MetricPoint) Equal(that interface{}) bool
func (*MetricPoint) GetName ¶
func (m *MetricPoint) GetName() string
func (*MetricPoint) GetTags ¶
func (m *MetricPoint) GetTags() []*MetricTag
func (*MetricPoint) GetTimestamp ¶
func (m *MetricPoint) GetTimestamp() int64
func (*MetricPoint) GetValue ¶
func (m *MetricPoint) GetValue() float64
func (*MetricPoint) Marshal ¶
func (m *MetricPoint) Marshal() (dAtA []byte, err error)
func (*MetricPoint) ProtoMessage ¶
func (*MetricPoint) ProtoMessage()
func (*MetricPoint) Reset ¶
func (m *MetricPoint) Reset()
func (*MetricPoint) Size ¶
func (m *MetricPoint) Size() (n int)
func (*MetricPoint) String ¶
func (m *MetricPoint) String() string
func (*MetricPoint) Unmarshal ¶
func (m *MetricPoint) Unmarshal(dAtA []byte) error
type MetricTag ¶
type MetricTag struct {
// The metric tag name.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The metric tag value.
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
A MetricTag adds a dimension to a metric point.
func FixtureMetricTag ¶
func FixtureMetricTag() *MetricTag
FixtureMetricTag returns a testing fixture for a Metric Tag object.
func NewPopulatedMetricTag ¶
func (*MetricTag) Descriptor ¶
func (*MetricTag) ProtoMessage ¶
func (*MetricTag) ProtoMessage()
type Metrics ¶
type Metrics struct {
// Handlers is a list of handlers for the metric points.
Handlers []string `protobuf:"bytes,1,rep,name=handlers" json:"handlers"`
// Points is a list of metric points (measurements).
Points []*MetricPoint `protobuf:"bytes,2,rep,name=points" json:"points"`
}
A Metrics is an event metrics payload specification.
func FixtureMetrics ¶
func FixtureMetrics() *Metrics
FixtureMetrics returns a testing fixture for a Metrics object.
func NewPopulatedMetrics ¶
func (*Metrics) Descriptor ¶
func (*Metrics) GetHandlers ¶
func (*Metrics) GetPoints ¶
func (m *Metrics) GetPoints() []*MetricPoint
func (*Metrics) ProtoMessage ¶
func (*Metrics) ProtoMessage()
type MultitenantResource ¶
MultitenantResource is a object that belongs to an organization
type Mutator ¶
type Mutator struct {
// Name is the unique identifier for a mutator.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Command is the command to be executed.
Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
// Timeout is the command execution timeout in seconds.
Timeout uint32 `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout"`
// Env is a list of environment variables to use with command execution
EnvVars []string `protobuf:"bytes,4,rep,name=env_vars,json=envVars" json:"env_vars"`
// Environment indicates to which env a mutator belongs to
Environment string `protobuf:"bytes,5,opt,name=environment,proto3" json:"environment,omitempty"`
// Organization specifies the organization to which the mutator belongs.
Organization string `protobuf:"bytes,6,opt,name=organization,proto3" json:"organization,omitempty"`
}
A Mutator is a mutator specification.
func FakeMutatorCommand ¶
FakeMutatorCommand takes a command and (optionally) command args and will execute the TestHelperMutatorProcess test within the package FakeMutatorCommand is called from.
func FixtureMutator ¶
FixtureMutator returns a Mutator fixture for testing.
func NewPopulatedMutator ¶
func (*Mutator) Descriptor ¶
func (*Mutator) GetCommand ¶
func (*Mutator) GetEnvVars ¶
func (*Mutator) GetEnvironment ¶
func (*Mutator) GetOrganization ¶
func (*Mutator) GetTimeout ¶
func (*Mutator) ProtoMessage ¶
func (*Mutator) ProtoMessage()
type Network ¶
type Network struct {
Interfaces []NetworkInterface `protobuf:"bytes,1,rep,name=interfaces" json:"interfaces"`
}
Network contains information about the system network interfaces that the Agent process is running on, used for additional Entity context.
func NewPopulatedNetwork ¶
func (*Network) Descriptor ¶
func (*Network) GetInterfaces ¶
func (m *Network) GetInterfaces() []NetworkInterface
func (*Network) ProtoMessage ¶
func (*Network) ProtoMessage()
type NetworkInterface ¶
type NetworkInterface struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
MAC string `protobuf:"bytes,2,opt,name=mac,proto3" json:"mac,omitempty"`
Addresses []string `protobuf:"bytes,3,rep,name=addresses" json:"addresses"`
}
NetworkInterface contains information about a system network interface.
func NewPopulatedNetworkInterface ¶
func NewPopulatedNetworkInterface(r randyEntity, easy bool) *NetworkInterface
func (*NetworkInterface) Descriptor ¶
func (*NetworkInterface) Descriptor() ([]byte, []int)
func (*NetworkInterface) Equal ¶
func (this *NetworkInterface) Equal(that interface{}) bool
func (*NetworkInterface) GetAddresses ¶
func (m *NetworkInterface) GetAddresses() []string
func (*NetworkInterface) GetMAC ¶
func (m *NetworkInterface) GetMAC() string
func (*NetworkInterface) GetName ¶
func (m *NetworkInterface) GetName() string
func (*NetworkInterface) Marshal ¶
func (m *NetworkInterface) Marshal() (dAtA []byte, err error)
func (*NetworkInterface) ProtoMessage ¶
func (*NetworkInterface) ProtoMessage()
func (*NetworkInterface) Reset ¶
func (m *NetworkInterface) Reset()
func (*NetworkInterface) Size ¶
func (m *NetworkInterface) Size() (n int)
func (*NetworkInterface) String ¶
func (m *NetworkInterface) String() string
func (*NetworkInterface) Unmarshal ¶
func (m *NetworkInterface) Unmarshal(dAtA []byte) error
type Organization ¶
type Organization struct {
// Description is more information for an organization.
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description"`
// Name is the unique identifier for an organization.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"`
}
Organization represents a Sensu organization in RBAC
func FixtureOrganization ¶
func FixtureOrganization(name string) *Organization
FixtureOrganization returns a mocked organization
func NewPopulatedOrganization ¶
func NewPopulatedOrganization(r randyOrganization, easy bool) *Organization
func (*Organization) Descriptor ¶
func (*Organization) Descriptor() ([]byte, []int)
func (*Organization) Equal ¶
func (this *Organization) Equal(that interface{}) bool
func (*Organization) GetDescription ¶
func (m *Organization) GetDescription() string
func (*Organization) GetName ¶
func (m *Organization) GetName() string
func (*Organization) Marshal ¶
func (m *Organization) Marshal() (dAtA []byte, err error)
func (*Organization) ProtoMessage ¶
func (*Organization) ProtoMessage()
func (*Organization) Reset ¶
func (m *Organization) Reset()
func (*Organization) Size ¶
func (m *Organization) Size() (n int)
func (*Organization) String ¶
func (m *Organization) String() string
func (*Organization) URIPath ¶
func (o *Organization) URIPath() string
URIPath returns the path component of a Organization URI.
func (*Organization) Unmarshal ¶
func (m *Organization) Unmarshal(dAtA []byte) error
func (*Organization) Validate ¶
func (o *Organization) Validate() error
Validate returns an error if the organization does not pass validation tests
type ProxyRequests ¶
type ProxyRequests struct {
// EntityAttributes store serialized arbitrary JSON-encoded data to match
// entities in the registry.
EntityAttributes []string `protobuf:"bytes,1,rep,name=entity_attributes,json=entityAttributes" json:"entity_attributes"`
// Splay indicates if proxy check requests should be splayed, published evenly
// over a window of time.
Splay bool `protobuf:"varint,2,opt,name=splay,proto3" json:"splay"`
// SplayCoverage is the percentage used for proxy check request splay
// calculation.
SplayCoverage uint32 `protobuf:"varint,3,opt,name=splay_coverage,json=splayCoverage,proto3" json:"splay_coverage"`
}
A ProxyRequests represents a request to execute a proxy check
func FixtureProxyRequests ¶
func FixtureProxyRequests(splay bool) *ProxyRequests
FixtureProxyRequests returns a fixture for a ProxyRequests object.
func NewPopulatedProxyRequests ¶
func NewPopulatedProxyRequests(r randyCheck, easy bool) *ProxyRequests
func (*ProxyRequests) Descriptor ¶
func (*ProxyRequests) Descriptor() ([]byte, []int)
func (*ProxyRequests) Equal ¶
func (this *ProxyRequests) Equal(that interface{}) bool
func (*ProxyRequests) GetEntityAttributes ¶
func (m *ProxyRequests) GetEntityAttributes() []string
func (*ProxyRequests) GetSplay ¶
func (m *ProxyRequests) GetSplay() bool
func (*ProxyRequests) GetSplayCoverage ¶
func (m *ProxyRequests) GetSplayCoverage() uint32
func (*ProxyRequests) Marshal ¶
func (m *ProxyRequests) Marshal() (dAtA []byte, err error)
func (*ProxyRequests) ProtoMessage ¶
func (*ProxyRequests) ProtoMessage()
func (*ProxyRequests) Reset ¶
func (m *ProxyRequests) Reset()
func (*ProxyRequests) Size ¶
func (m *ProxyRequests) Size() (n int)
func (*ProxyRequests) String ¶
func (m *ProxyRequests) String() string
func (*ProxyRequests) Unmarshal ¶
func (m *ProxyRequests) Unmarshal(dAtA []byte) error
func (*ProxyRequests) Validate ¶
func (p *ProxyRequests) Validate() error
Validate returns an error if the ProxyRequests does not pass validation tests
type Queue ¶
type Queue interface {
// Enqueue adds a new item to the queue. It returns any error that
// was encountered in doing so, or if the context is cancelled.
Enqueue(ctx context.Context, value string) error
// Dequeue gets an Item from the queue. It returns the Item and any
// error encountered, or if the context is cancelled.
Dequeue(ctx context.Context) (QueueItem, error)
}
Queue is the interface of a queue. Queue's methods are atomic and goroutine-safe.
type QueueGetter ¶
QueueGetter is a type that provides a way to get a Queue.
type QueueItem ¶
type QueueItem interface {
// Value is the item's underlying value.
Value() string
// Ack acks the item. The item will no longer be stored.
Ack(context.Context) error
// Nack nacks the item. The item will return to the Queue.
Nack(context.Context) error
}
QueueItem represents an item retrieved from a Queue.
type Resource ¶
type Resource interface {
// URIPath gives the path to the resource, e.g. /checks/checkname
URIPath() string
// Validate checks if the fields in the resource are valid.
Validate() error
}
Resource represents a Sensu resource.
func ResolveResource ¶
ResolveResource returns a zero-valued resource, given a name. If the named type does not exist, or if the type is not a Resource, then an error will be returned.
type Ring ¶
type Ring interface {
// Add adds an item to the ring. It returns a non-nil error if the
// operation failed, or the context is cancelled before the operation
// completed.
Add(ctx context.Context, value string) error
// Remove removes an item from the ring. It returns a non-nil error if the
// operation failed, or the context is cancelled before the operation
// completed.
Remove(ctx context.Context, value string) error
// Next gets the next item in the Ring. The other items in the Ring will
// all be returned by subsequent calls to Next before this item is
// returned again. Next returns the selected value, and an error indicating
// if the operation failed, or if the context was cancelled.
Next(context.Context) (string, error)
// Peek gets the next item in the Ring, but does not advance the iteration.
Peek(context.Context) (string, error)
}
Ring is the interface of a ring. Ring's methods are atomic and goroutine-safe.
type RingGetter ¶
RingGetter provides a way to get a Ring.
type Role ¶
type Role struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Rules []Rule `protobuf:"bytes,2,rep,name=rules" json:"rules"`
}
Role describes set of rules
func NewPopulatedRole ¶
func (*Role) Descriptor ¶
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
type Rule ¶
type Rule struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
Environment string `protobuf:"bytes,2,opt,name=environment,proto3" json:"environment,omitempty"`
Organization string `protobuf:"bytes,3,opt,name=organization,proto3" json:"organization,omitempty"`
Permissions []string `protobuf:"bytes,4,rep,name=permissions" json:"permissions"`
}
Rule maps permissions to a given type
func FixtureRuleWithPerms ¶
FixtureRuleWithPerms returns a partial rule with perms applied
func NewPopulatedRule ¶
func (*Rule) Descriptor ¶
func (*Rule) GetEnvironment ¶
func (*Rule) GetOrganization ¶
func (*Rule) GetPermissions ¶
func (*Rule) ProtoMessage ¶
func (*Rule) ProtoMessage()
type Silenced ¶
type Silenced struct {
// ID is the combination of subscription and check name (subscription:checkname)
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Expire is the number of seconds the entry will live
Expire int64 `protobuf:"varint,2,opt,name=expire,proto3" json:"expire"`
// ExpireOnResolve defaults to false, clears the entry on resolution when set
// to true
ExpireOnResolve bool `protobuf:"varint,3,opt,name=expire_on_resolve,json=expireOnResolve,proto3" json:"expire_on_resolve"`
// Creator is the author of the silenced entry
Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"`
// Check is the name of the check event to be silenced.
Check string `protobuf:"bytes,5,opt,name=check,proto3" json:"check,omitempty"`
// Reason is used to provide context to the entry
Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"`
// Subscription is the name of the subscription to which the entry applies.
Subscription string `protobuf:"bytes,7,opt,name=subscription,proto3" json:"subscription,omitempty"`
// Organization indicates to which org a silenced entry belongs to.
Organization string `protobuf:"bytes,8,opt,name=organization,proto3" json:"organization,omitempty"`
// Environment indicates which env a silenced entry belongs to.
Environment string `protobuf:"bytes,9,opt,name=environment,proto3" json:"environment,omitempty"`
// Begin is a timestamp at which the silenced entry takes effect.
Begin int64 `protobuf:"varint,10,opt,name=begin,proto3" json:"begin"`
}
Silenced is the representation of a silence entry.
func FixtureSilenced ¶
FixtureSilenced returns a testing fixutre for a Silenced event struct.
func NewPopulatedSilenced ¶
func (*Silenced) Descriptor ¶
func (*Silenced) GetCreator ¶
func (*Silenced) GetEnvironment ¶
func (*Silenced) GetExpireOnResolve ¶
func (*Silenced) GetOrganization ¶
func (*Silenced) GetSubscription ¶
func (*Silenced) ProtoMessage ¶
func (*Silenced) ProtoMessage()
func (*Silenced) StartSilence ¶
StartSilence returns true if the current unix timestamp is less than the begin timestamp.
type System ¶
type System struct {
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
OS string `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"`
Platform string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"`
PlatformFamily string `protobuf:"bytes,4,opt,name=platform_family,json=platformFamily,proto3" json:"platform_family,omitempty"`
PlatformVersion string `protobuf:"bytes,5,opt,name=platform_version,json=platformVersion,proto3" json:"platform_version,omitempty"`
Network Network `protobuf:"bytes,6,opt,name=network" json:"network"`
Arch string `protobuf:"bytes,7,opt,name=arch,proto3" json:"arch,omitempty"`
}
System contains information about the system that the Agent process is running on, used for additional Entity context.
func NewPopulatedSystem ¶
func (*System) Descriptor ¶
func (*System) GetHostname ¶
func (*System) GetNetwork ¶
func (*System) GetPlatform ¶
func (*System) GetPlatformFamily ¶
func (*System) GetPlatformVersion ¶
func (*System) ProtoMessage ¶
func (*System) ProtoMessage()
type TLSOptions ¶
type TLSOptions struct {
CertFile string `protobuf:"bytes,1,opt,name=cert_file,json=certFile,proto3" json:"cert_file,omitempty"`
KeyFile string `protobuf:"bytes,2,opt,name=key_file,json=keyFile,proto3" json:"key_file,omitempty"`
TrustedCAFile string `protobuf:"bytes,3,opt,name=trusted_ca_file,json=trustedCaFile,proto3" json:"trusted_ca_file,omitempty"`
InsecureSkipVerify bool `protobuf:"varint,4,opt,name=insecure_skip_verify,json=insecureSkipVerify,proto3" json:"insecure_skip_verify"`
}
TLSOptions holds TLS options that are used across the varying Sensu components
func NewPopulatedTLSOptions ¶
func NewPopulatedTLSOptions(r randyTls, easy bool) *TLSOptions
func (*TLSOptions) Descriptor ¶
func (*TLSOptions) Descriptor() ([]byte, []int)
func (*TLSOptions) Equal ¶
func (this *TLSOptions) Equal(that interface{}) bool
func (*TLSOptions) GetCertFile ¶
func (m *TLSOptions) GetCertFile() string
func (*TLSOptions) GetInsecureSkipVerify ¶
func (m *TLSOptions) GetInsecureSkipVerify() bool
func (*TLSOptions) GetKeyFile ¶
func (m *TLSOptions) GetKeyFile() string
func (*TLSOptions) GetTrustedCAFile ¶
func (m *TLSOptions) GetTrustedCAFile() string
func (*TLSOptions) Marshal ¶
func (m *TLSOptions) Marshal() (dAtA []byte, err error)
func (*TLSOptions) ProtoMessage ¶
func (*TLSOptions) ProtoMessage()
func (*TLSOptions) Reset ¶
func (m *TLSOptions) Reset()
func (*TLSOptions) Size ¶
func (m *TLSOptions) Size() (n int)
func (*TLSOptions) String ¶
func (m *TLSOptions) String() string
func (*TLSOptions) ToTLSConfig ¶
func (t *TLSOptions) ToTLSConfig() (*tls.Config, error)
ToTLSConfig outputs a tls.Config from TLSOptions
func (*TLSOptions) Unmarshal ¶
func (m *TLSOptions) Unmarshal(dAtA []byte) error
type TimeWindowDays ¶
type TimeWindowDays struct {
All []*TimeWindowTimeRange `protobuf:"bytes,1,rep,name=all" json:"all,omitempty"`
Sunday []*TimeWindowTimeRange `protobuf:"bytes,2,rep,name=sunday" json:"sunday,omitempty"`
Monday []*TimeWindowTimeRange `protobuf:"bytes,3,rep,name=monday" json:"monday,omitempty"`
Tuesday []*TimeWindowTimeRange `protobuf:"bytes,4,rep,name=tuesday" json:"tuesday,omitempty"`
Wednesday []*TimeWindowTimeRange `protobuf:"bytes,5,rep,name=wednesday" json:"wednesday,omitempty"`
Thursday []*TimeWindowTimeRange `protobuf:"bytes,6,rep,name=thursday" json:"thursday,omitempty"`
Friday []*TimeWindowTimeRange `protobuf:"bytes,7,rep,name=friday" json:"friday,omitempty"`
Saturday []*TimeWindowTimeRange `protobuf:"bytes,8,rep,name=saturday" json:"saturday,omitempty"`
}
TimeWindowDays defines the days of a time window
func NewPopulatedTimeWindowDays ¶
func NewPopulatedTimeWindowDays(r randyTimeWindow, easy bool) *TimeWindowDays
func (*TimeWindowDays) Descriptor ¶
func (*TimeWindowDays) Descriptor() ([]byte, []int)
func (*TimeWindowDays) Equal ¶
func (this *TimeWindowDays) Equal(that interface{}) bool
func (*TimeWindowDays) GetAll ¶
func (m *TimeWindowDays) GetAll() []*TimeWindowTimeRange
func (*TimeWindowDays) GetFriday ¶
func (m *TimeWindowDays) GetFriday() []*TimeWindowTimeRange
func (*TimeWindowDays) GetMonday ¶
func (m *TimeWindowDays) GetMonday() []*TimeWindowTimeRange
func (*TimeWindowDays) GetSaturday ¶
func (m *TimeWindowDays) GetSaturday() []*TimeWindowTimeRange
func (*TimeWindowDays) GetSunday ¶
func (m *TimeWindowDays) GetSunday() []*TimeWindowTimeRange
func (*TimeWindowDays) GetThursday ¶
func (m *TimeWindowDays) GetThursday() []*TimeWindowTimeRange
func (*TimeWindowDays) GetTuesday ¶
func (m *TimeWindowDays) GetTuesday() []*TimeWindowTimeRange
func (*TimeWindowDays) GetWednesday ¶
func (m *TimeWindowDays) GetWednesday() []*TimeWindowTimeRange
func (*TimeWindowDays) Marshal ¶
func (m *TimeWindowDays) Marshal() (dAtA []byte, err error)
func (*TimeWindowDays) ProtoMessage ¶
func (*TimeWindowDays) ProtoMessage()
func (*TimeWindowDays) Reset ¶
func (m *TimeWindowDays) Reset()
func (*TimeWindowDays) Size ¶
func (m *TimeWindowDays) Size() (n int)
func (*TimeWindowDays) String ¶
func (m *TimeWindowDays) String() string
func (*TimeWindowDays) Unmarshal ¶
func (m *TimeWindowDays) Unmarshal(dAtA []byte) error
type TimeWindowTimeRange ¶
type TimeWindowTimeRange struct {
// Begin is the time which the time window should begin, in the format
// '3:00PM', which satisfies the time.Kitchen format
Begin string `protobuf:"bytes,1,opt,name=begin,proto3" json:"begin"`
// End is the time which the filter should end, in the format '3:00PM', which
// satisfies the time.Kitchen format
End string `protobuf:"bytes,2,opt,name=end,proto3" json:"end"`
}
TimeWindowTimeRange defines the time ranges of a time
func NewPopulatedTimeWindowTimeRange ¶
func NewPopulatedTimeWindowTimeRange(r randyTimeWindow, easy bool) *TimeWindowTimeRange
func (*TimeWindowTimeRange) Descriptor ¶
func (*TimeWindowTimeRange) Descriptor() ([]byte, []int)
func (*TimeWindowTimeRange) Equal ¶
func (this *TimeWindowTimeRange) Equal(that interface{}) bool
func (*TimeWindowTimeRange) GetBegin ¶
func (m *TimeWindowTimeRange) GetBegin() string
func (*TimeWindowTimeRange) GetEnd ¶
func (m *TimeWindowTimeRange) GetEnd() string
func (*TimeWindowTimeRange) InWindow ¶
func (t *TimeWindowTimeRange) InWindow(current time.Time) (bool, error)
InWindow determines if the current time falls between the provided time window. Current should typically be time.Now() but to allow easier tests, it must be provided as a parameter. Begin and end parameters must be strings representing an hour of the day in the time.Kitchen format (e.g. "3:04PM")
func (*TimeWindowTimeRange) Marshal ¶
func (m *TimeWindowTimeRange) Marshal() (dAtA []byte, err error)
func (*TimeWindowTimeRange) MarshalTo ¶
func (m *TimeWindowTimeRange) MarshalTo(dAtA []byte) (int, error)
func (*TimeWindowTimeRange) ProtoMessage ¶
func (*TimeWindowTimeRange) ProtoMessage()
func (*TimeWindowTimeRange) Reset ¶
func (m *TimeWindowTimeRange) Reset()
func (*TimeWindowTimeRange) Size ¶
func (m *TimeWindowTimeRange) Size() (n int)
func (*TimeWindowTimeRange) String ¶
func (m *TimeWindowTimeRange) String() string
func (*TimeWindowTimeRange) Unmarshal ¶
func (m *TimeWindowTimeRange) Unmarshal(dAtA []byte) error
func (*TimeWindowTimeRange) Validate ¶
func (t *TimeWindowTimeRange) Validate() error
Validate ensures the TimeWindowTimeRange is valid.
type TimeWindowWhen ¶
type TimeWindowWhen struct {
// Days is a hash of days
Days TimeWindowDays `protobuf:"bytes,1,opt,name=days" json:"days"`
}
TimeWindowWhen defines the "when" attributes for time windows
func NewPopulatedTimeWindowWhen ¶
func NewPopulatedTimeWindowWhen(r randyTimeWindow, easy bool) *TimeWindowWhen
func (*TimeWindowWhen) Descriptor ¶
func (*TimeWindowWhen) Descriptor() ([]byte, []int)
func (*TimeWindowWhen) Equal ¶
func (this *TimeWindowWhen) Equal(that interface{}) bool
func (*TimeWindowWhen) GetDays ¶
func (m *TimeWindowWhen) GetDays() TimeWindowDays
func (*TimeWindowWhen) InWindows ¶
func (t *TimeWindowWhen) InWindows(current time.Time) (bool, error)
InWindows determines if the current time falls between the provided time windows. Current should typically be time.Now() but to allow easier tests, it must be provided as a parameter. The function returns a positive value as soon the current time falls within a time window
func (*TimeWindowWhen) MapTimeWindows ¶
func (t *TimeWindowWhen) MapTimeWindows() map[string][]*TimeWindowTimeRange
MapTimeWindows returns a map of all the time windows in t.
func (*TimeWindowWhen) Marshal ¶
func (m *TimeWindowWhen) Marshal() (dAtA []byte, err error)
func (*TimeWindowWhen) ProtoMessage ¶
func (*TimeWindowWhen) ProtoMessage()
func (*TimeWindowWhen) Reset ¶
func (m *TimeWindowWhen) Reset()
func (*TimeWindowWhen) Size ¶
func (m *TimeWindowWhen) Size() (n int)
func (*TimeWindowWhen) String ¶
func (m *TimeWindowWhen) String() string
func (*TimeWindowWhen) Unmarshal ¶
func (m *TimeWindowWhen) Unmarshal(dAtA []byte) error
func (*TimeWindowWhen) Validate ¶
func (t *TimeWindowWhen) Validate() error
Validate ensures that all the time windows in t can be parsed.
type Tokens ¶
type Tokens struct {
// Access token is used by client to make request
Access string `protobuf:"bytes,1,opt,name=access,proto3" json:"access_token"`
// ExpiresAt unix timestamp describing when the access token is no longer valid
ExpiresAt int64 `protobuf:"varint,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at"`
// Refresh token is used by client to request a new access token
Refresh string `protobuf:"bytes,3,opt,name=refresh,proto3" json:"refresh_token"`
}
Tokens contains the structure for exchanging tokens with the API
func FixtureTokens ¶
FixtureTokens given an access and refresh tokens returns valid tokens for use in tests
func NewPopulatedTokens ¶
func (*Tokens) Descriptor ¶
func (*Tokens) GetExpiresAt ¶
func (*Tokens) GetRefresh ¶
func (*Tokens) ProtoMessage ¶
func (*Tokens) ProtoMessage()
type User ¶
type User struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
Roles []string `protobuf:"bytes,3,rep,name=roles" json:"roles,omitempty"`
Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled"`
}
User describes an authenticated user
func FixtureUser ¶
FixtureUser returns a testing fixture for an Entity object.
func NewPopulatedUser ¶
func (*User) Descriptor ¶
func (*User) GetDisabled ¶
func (*User) GetPassword ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ValidatePassword ¶
ValidatePassword returns an error if the entity is invalid.
type Wrapper ¶
type Wrapper struct {
// Type is the fully-qualified type name, e.g.
// github.com/sensu/sensu-go/types.Check,
// OR, a short-hand name that assumes a package path of
// github.com/sensu/sensu-go/types.
Type string `json:"type"`
// Value is a valid Resource of concrete type Type.
Value Resource `json:"spec"`
}
Wrapper is a generic wrapper, with a type field for distinguishing its contents.
func WrapResource ¶
WrapResource uses reflection on a Resource to wrap it in a Wrapper
Source Files
¶
- adhoc.go
- adhoc.pb.go
- any.pb.go
- asset.go
- asset.pb.go
- authentication.go
- authentication.pb.go
- check.go
- check.pb.go
- context.go
- entity.go
- entity.pb.go
- env_vars.go
- environment.go
- environment.pb.go
- error.go
- error.pb.go
- event.go
- event.pb.go
- extension.go
- extension.pb.go
- filter.go
- filter.pb.go
- handler.go
- handler.pb.go
- hook.go
- hook.pb.go
- keepalive.go
- keepalive.pb.go
- metrics.go
- metrics.pb.go
- multitenant.go
- mutator.go
- mutator.pb.go
- organization.go
- organization.pb.go
- protocol.go
- queue.go
- rbac.go
- rbac.pb.go
- resource.go
- ring.go
- silenced.go
- silenced.pb.go
- status_map.go
- time_window.go
- time_window.pb.go
- tls.go
- tls.pb.go
- token.go
- typemap.go
- types_gen.go
- user.go
- user.pb.go
- util.go
- validators.go
- wrapper.go