v2

package module
Version: v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: MIT Imports: 33 Imported by: 291

Documentation

Index

Constants

View Source
const (
	// CheckRequestType is the message type string for check request.
	CheckRequestType = "check_request"

	// ChecksResource is the name of this resource type
	ChecksResource = "checks"

	// DefaultSplayCoverage is the default splay coverage for proxy check requests
	DefaultSplayCoverage = 90.0

	// NagiosOutputMetricFormat is the accepted string to represent the output metric format of
	// Nagios Perf Data
	NagiosOutputMetricFormat = "nagios_perfdata"

	// GraphiteOutputMetricFormat is the accepted string to represent the output metric format of
	// Graphite Plain Text
	GraphiteOutputMetricFormat = "graphite_plaintext"

	// OpenTSDBOutputMetricFormat is the accepted string to represent the output metric format of
	// OpenTSDB Line
	OpenTSDBOutputMetricFormat = "opentsdb_line"

	// InfluxDBOutputMetricFormat is the accepted string to represent the output metric format of
	// InfluxDB Line
	InfluxDBOutputMetricFormat = "influxdb_line"

	// PrometheusOutputMetricFormat is the accepted string to represent the output metric format of
	// Prometheus Exposition Text Format
	PrometheusOutputMetricFormat = "prometheus_text"

	// KeepaliveCheckName is the name of the check that is created when a
	// keepalive timeout occurs.
	KeepaliveCheckName = "keepalive"

	// RegistrationCheckName is the name of the check that is created when an
	// entity sends a keepalive and the entity does not yet exist in the store.
	RegistrationCheckName = "registration"

	// BackendCheckName is the name fo the check that is created when a backend
	// event is generated from an error.
	BackendCheckName = "backend"

	// MemoryScheduler indicates that a check is scheduled in-memory.
	MemoryScheduler = "memory"

	// EtcdScheduler indicates that a check is scheduled with etcd leases and
	// watchers.
	EtcdScheduler = "etcd"

	// PostgresScheduler indicates that a check is scheduled with postgresql,
	// using transactions and asynchronous notification (NOTIFY).
	PostgresScheduler = "postgres"
)
View Source
const (
	// AccessTokenString is the key name used to retrieve the access token string
	AccessTokenString key = iota

	// AccessTokenClaims contains the key name to retrieve the access token claims
	AccessTokenClaims

	// ClaimsKey contains key name to retrieve the jwt claims from context
	ClaimsKey

	// NamespaceKey contains the key name to retrieve the namespace from context
	NamespaceKey

	// RefreshTokenClaims contains the key name to retrieve the refresh token claims
	RefreshTokenClaims

	// RefreshTokenString contains the key name to retrieve the refresh token string
	RefreshTokenString

	// AuthorizationAttributesKey is the key name used to store authorization
	// attributes extracted from a request
	AuthorizationAttributesKey

	// StoreKey contains the key name to retrieve the etcd store from within a context
	StoreKey

	// PageContinueKey contains the continue token used in pagination
	PageContinueKey

	// PageSizeKey contains the page size used in pagination
	PageSizeKey

	// PipelineKey contains the key name to retrieve the pipeline from context
	PipelineKey

	// PipelineWorkflowKey contains the key name to retrieve the pipeline workflow from context
	PipelineWorkflowKey
)
View Source
const (
	// APIGroupName is the group name for this API
	APIGroupName = "core"

	// APIVersion is the version for this API
	APIVersion = "v2"
)
View Source
const (
	// CoreEdition represents the Sensu Core Edition (CE)
	// <DEPRECATED>
	CoreEdition = "core"

	// EditionHeader represents the HTTP header containing the edition value
	// <DEPRECATED>
	EditionHeader = "Sensu-Edition"
)
View Source
const (
	// EntitiesResource is the name of this resource type
	EntitiesResource = "entities"

	// 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"

	// EntityBackendClass is the name of the class given to backend entities.
	EntityBackendClass = "backend"

	// EntityServiceClass is the name of the class given to BSM service entities.
	EntityServiceClass = "service"

	// Redacted is filled in for fields that contain sensitive information
	Redacted = "REDACTED"
)
View Source
const (
	EntitySortName     = "NAME"
	EntitySortLastSeen = "LAST_SEEN"
)
View Source
const (
	// EventsResource is the name of this resource type
	EventsResource = "events"

	// EventFailingState indicates failing check result status
	EventFailingState = "failing"

	// EventFlappingState indicates a rapid change in check result status
	EventFlappingState = "flapping"

	// EventPassingState indicates successful check result status
	EventPassingState = "passing"
)
View Source
const (
	EventSortEntity    = "ENTITY"
	EventSortLastOk    = "LASTOK"
	EventSortSeverity  = "SEVERITY"
	EventSortTimestamp = "TIMESTAMP"
)
View Source
const (
	// EventFiltersResource is the name of this resource type
	EventFiltersResource = "filters"

	// 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
)
View Source
const (
	// HandlersResource is the name of this resource type
	HandlersResource = "handlers"

	// 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"

	// KeepaliveHandlerName is the name of the handler that is executed when
	// a keepalive timeout occurs.
	KeepaliveHandlerName = "keepalive"

	// RegistrationHandlerName is the name of the handler that is executed when
	// a registration event is passed to pipelined.
	RegistrationHandlerName = "registration"
)
View Source
const (
	// HooksResource is the name of this resource type
	HooksResource = "hooks"

	// HookRequestType is the message type string for hook request.
	HookRequestType = "hook_request"
)
View Source
const (
	JavascriptMutator = "javascript"
	PipeMutator       = "pipe"
)
View Source
const (
	// NamespaceTypeAll represents an empty namespace, used to represent a request
	// across all namespaces
	NamespaceTypeAll = ""

	// NamespacesResource is the name of this resource type
	NamespacesResource = "namespaces"
)
View Source
const (
	// ClusterRolesResource is the name of this resource type
	ClusterRolesResource = "clusterroles"

	// ClusterRoleBindingsResource is the name of this resource type
	ClusterRoleBindingsResource = "clusterrolebindings"

	// RolesResource is the name of this resource type
	RolesResource = "roles"

	// RoleBindingsResource is the name of this resource type
	RoleBindingsResource = "rolebindings"

	// ResourceAll represents all possible resources
	ResourceAll = "*"
	// VerbAll represents all possible verbs
	VerbAll = "*"

	// GroupType represents a group object in a subject
	GroupType = "Group"
	// UserType represents a user object in a subject
	UserType = "User"

	// ClusterRoleType represents a ClusterRole in a RoleRef
	ClusterRoleType = "ClusterRole"
	// RoleType represents a Role in a RoleRef
	RoleType = "Role"

	// LocalSelfUserResource represents a local user trying to view itself
	// or change its password
	LocalSelfUserResource = "localselfuser"
)
View Source
const (
	CheckStatusOk       = uint32(0)
	CheckStatusWarning  = uint32(1)
	CheckStatusCritical = uint32(2)

	CheckStatusCaptionOk       = "ok"
	CheckStatusCaptionWarning  = "warning"
	CheckStatusCaptionCritical = "critical"
	CheckStatusCaptionUnknown  = "unknown"
)
View Source
const (

	// LowerBound is the minimum interval that tessen will phone home, in seconds
	LowerBound = 60

	// UpperBound is the maximum interval that tessen will phone home, in seconds
	UpperBound = 21600

	// DefaultTessenInterval is the default interval at which tessen will phone home, in seconds
	DefaultTessenInterval = 1800

	// TessenResource is the name of this resource type
	TessenResource = "tessen"
)
View Source
const (
	RepeatPeriodAnnually   = "annually"
	RepeatPeriodMonthly    = "monthly"
	RepeatPeriodWeekly     = "weekly"
	RepeatPeriodWeekdays   = "weekdays"
	RepeatPeriodWeekends   = "weekends"
	RepeatPeriodDaily      = "daily"
	RepeatPeriodSundays    = "sundays"
	RepeatPeriodMondays    = "mondays"
	RepeatPeriodTuesdays   = "tuesdays"
	RepeatPeriodWednesdays = "wednesdays"
	RepeatPeriodThursdays  = "thursdays"
	RepeatPeriodFridays    = "fridays"
	RepeatPeriodSaturdays  = "saturdays"
)
View Source
const (
	// APIKeysResource is the name of this resource type.
	APIKeysResource = "apikeys"
)
View Source
const AgentHandshakeType = "agent_handshake"

AgentHandshakeType is the message type string for an AgentHandshake

View Source
const (
	// AssetsResource is the name of this resource type
	AssetsResource = "assets"
)
View Source
const BackendHandshakeType = "backend_handshake"

BackendHandshakeType is the message type string for a BackendHandshake

View Source
const DefaultKeepaliveTimeout = 120

DefaultKeepaliveTimeout specifies the default keepalive timeout

View Source
const (
	// ExtensionsResource is the name of this resource type
	ExtensionsResource = "extensions"
)
View Source
const (
	// ManagedByLabel is used to identify which client was used to create/update a
	// resource
	ManagedByLabel = "sensu.io/managed_by"
)
View Source
const (
	// MutatorsResource is the name of this resource type
	MutatorsResource = "mutators"
)
View Source
const PaginationContinueHeader = "Sensu-Continue"

PaginationContinueHeader is the name of the header used by the API to return a potential continue token when paginating.

View Source
const (
	// PipelinesResource is the name of this resource type
	PipelinesResource = "pipelines"
)
View Source
const (
	// SilencedResource is the name of this resource type
	SilencedResource = "silenced"
)
View Source
const (
	// UsersResource is the name of this resource type
	UsersResource = "users"
)

Variables

View Source
var (
	ErrInvalidLengthAdhoc        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAdhoc          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAdhoc = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthAny        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAny          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthApikey        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApikey          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupApikey = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// AssetNameRegexStr used to validate name of asset
	AssetNameRegexStr = `[\w\/\_\.\-\:]+`

	// AssetNameRegex used to validate name of asset
	AssetNameRegex = regexp.MustCompile("^" + AssetNameRegexStr + "$")
)
View Source
var (
	ErrInvalidLengthAsset        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAsset          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAsset = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthAuthentication        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAuthentication          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAuthentication = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthCheck        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCheck          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCheck = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthEntity        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEntity          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEntity = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthEvent        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvent          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthExtension        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowExtension          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupExtension = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthFilter        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFilter          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFilter = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthHandler        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHandler          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHandler = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// CheckHookRegexStr used to validate type of check hook
	CheckHookRegexStr = `([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])`

	// CheckHookRegex used to validate type of check hook
	CheckHookRegex = regexp.MustCompile("^" + CheckHookRegexStr + "$")

	// Severities used to validate type of check hook
	Severities = []string{"ok", "warning", "critical", "unknown", "non-zero"}
)
View Source
var (
	ErrInvalidLengthHook        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHook          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHook = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthKeepalive        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowKeepalive          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupKeepalive = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMeta        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMeta          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMeta = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMetricThreshold        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMetricThreshold          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMetricThreshold = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMetrics        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMetrics          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMetrics = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMutator        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMutator          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMutator = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthNamespace        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowNamespace          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupNamespace = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPipeline        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPipeline          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPipeline = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPipelineWorkflow        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPipelineWorkflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPipelineWorkflow = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthRbac        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRbac          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRbac = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthResourceReference        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowResourceReference          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupResourceReference = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSecret        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSecret          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSecret = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthSilenced        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSilenced          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSilenced = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTessen        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTessen          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTessen = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTimeWindow        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTimeWindow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTimeWindow = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTls        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTls          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTls = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidToken = errors.New("invalid access or refresh token")
	ErrUnauthorized = errors.New("unauthorized")
)
View Source
var (
	ErrInvalidLengthUser        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowUser          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupUser = fmt.Errorf("proto: unexpected end of group")
)
View Source
var CommonCoreResources = []string{
	"assets",
	"checks",
	"entities",
	"events",
	"filters",
	"handlers",
	"hooks",
	"mutators",
	"silenced",
}

CommonCoreResources represents the common "core" resources found in a namespace

View Source
var (

	// DefaultCipherSuites overrides the default cipher suites in order to disable
	// CBC suites (Lucky13 attack) this means TLS 1.1 can't work (no GCM)
	// additionally, we should only use perfect forward secrecy ciphers
	DefaultCipherSuites = []uint16{
		tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
		tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
		tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
		tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,

		tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
		tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
	}
)
View Source
var DefaultRedactFields = []string{"password", "passwd", "pass", "api_key",
	"api_token", "access_key", "secret_key", "private_key", "secret"}

DefaultRedactFields contains the default fields to redact

View Source
var (
	// EventFilterAllActions is a list of actions that can be used by filters
	EventFilterAllActions = []string{
		EventFilterActionAllow,
		EventFilterActionDeny,
	}
)
View Source
var NameRegex = regexp.MustCompile(`\A[\w\.\-\:]+\z`)

NameRegex is used to validate the name of a resource

OutputMetricFormats represents all the accepted output_metric_format's a check can have

View Source
var StrictNameRegex = regexp.MustCompile(`\A[a-z0-9\_\.\-]+\z`)

StrictNameRegex is used to validate names of resources using a strict subset of charset.

View Source
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)

View Source
var URLPrefix = path.Join("/api", APIGroupName, APIVersion)

URLPrefix is the URL prefix of this API

Functions

func APIKeyFields

func APIKeyFields(r Resource) map[string]string

APIKeyFields returns a set of fields that represent that resource.

func AddEntitySubscription added in v2.2.4

func AddEntitySubscription(entityName string, subscriptions []string) []string

AddEntitySubscription appends the entity subscription (using the format "entity:entityName") to the subscriptions of an entity

func AddValidPipelineWorkflowFilterReference added in v2.11.0

func AddValidPipelineWorkflowFilterReference(ref ResourceReference)

AddValidPipelineWorkflowFilterReference adds a ResourceReference to the list of valid resource references for filters. Only the APIVersion and Type fields are used to validate resource references at this time.

func AddValidPipelineWorkflowHandlerReference added in v2.11.0

func AddValidPipelineWorkflowHandlerReference(ref ResourceReference)

AddValidPipelineWorkflowHandlerReference adds a ResourceReference to the list of valid resource references for handlers. Only the APIVersion and Type fields are used to validate resource references at this time.

func AddValidPipelineWorkflowMutatorReference added in v2.11.0

func AddValidPipelineWorkflowMutatorReference(ref ResourceReference)

AddValidPipelineWorkflowMutatorReference adds a ResourceReference to the list of valid resource references for mutators. Only the APIVersion and Type fields are used to validate resource references at this time.

func AssetFields

func AssetFields(r Resource) map[string]string

AssetFields returns a set of fields that represent that resource

func CheckConfigFields

func CheckConfigFields(r Resource) map[string]string

CheckConfigFields returns a set of fields that represent that resource

func CheckStatusToCaption added in v2.14.0

func CheckStatusToCaption(status uint32) string

func ClusterRoleBindingFields

func ClusterRoleBindingFields(r Resource) map[string]string

ClusterRoleBindingFields returns a set of fields that represent that resource

func ClusterRoleFields

func ClusterRoleFields(r Resource) map[string]string

ClusterRoleFields returns a set of fields that represent that resource

func ContextNamespace

func ContextNamespace(ctx context.Context) string

ContextNamespace returns the namespace injected in the context

func ContextPipeline added in v2.11.0

func ContextPipeline(ctx context.Context) string

ContextPipeline returns the pipeline injected in the context

func ContextPipelineWorkflow added in v2.11.0

func ContextPipelineWorkflow(ctx context.Context) string

ContextPipelineWorkflow returns the pipeline workflow injected in the context

func EntityFields

func EntityFields(r Resource) map[string]string

EntityFields returns a set of fields that represent that resource

func EnvVarsToMap

func EnvVarsToMap(vars []string) map[string]string

EnvVarsToMap converts a list of FOO=BAR key-value pairs into a map.

func EventFields

func EventFields(r Resource) map[string]string

EventFields returns a set of fields that represent that resource

func EventFilterFields

func EventFilterFields(r Resource) map[string]string

EventFilterFields returns a set of fields that represent that resource

func EventsByEntityName added in v2.5.0

func EventsByEntityName(es []*Event, asc bool) sort.Interface

EventsByEntityName can be used to sort a given collection of events by entity name (and secondarily by check name.)

func EventsByLastOk

func EventsByLastOk(es []*Event, asc bool) sort.Interface

EventsByLastOk can be used to sort a given collection of events by time it last received an OK status.

func EventsBySeverity

func EventsBySeverity(es []*Event, asc bool) sort.Interface

EventsBySeverity can be used to sort a given collection of events by check status and timestamp.

func EventsByTimestamp

func EventsByTimestamp(es []*Event, asc bool) sort.Interface

EventsByTimestamp can be used to sort a given collection of events by time it occurred.

func ExtensionFields

func ExtensionFields(r Resource) map[string]string

ExtensionFields returns a set of fields that represent that resource

func GetEntitySubscription

func GetEntitySubscription(entityName string) string

GetEntitySubscription returns the entity subscription, using the format "entity:entityName"

func HandlerFields

func HandlerFields(r Resource) map[string]string

HandlerFields returns a set of fields that represent that resource

func HookConfigFields

func HookConfigFields(r Resource) map[string]string

HookConfigFields returns a set of fields that represent that resource

func LoadCACerts

func LoadCACerts(path string) (*x509.CertPool, error)

LoadCACerts takes the path to a certificate bundle file in PEM format and try to create a x509.CertPool out of it.

func MutatorFields

func MutatorFields(r Resource) map[string]string

MutatorFields returns a set of fields that represent that resource

func NamespaceFields

func NamespaceFields(r Resource) map[string]string

NamespaceFields returns a set of fields that represent that resource

func PageContinueFromContext

func PageContinueFromContext(ctx context.Context) string

PageContinueFromContext returns the continue token stored in the given context, if any. Returns "" if none is found.

func PageSizeFromContext

func PageSizeFromContext(ctx context.Context) int

PageSizeFromContext returns the page size stored in the given context, if any. Returns 0 if none is found, typically meaning "unlimited" page size.

func PipelineFields added in v2.11.0

func PipelineFields(r Resource) map[string]string

PipelineFields returns a set of fields that represent that resource.

func RoleBindingFields

func RoleBindingFields(r Resource) map[string]string

RoleBindingFields returns a set of fields that represent that resource

func RoleFields

func RoleFields(r Resource) map[string]string

RoleFields returns a set of fields that represent that resource

func SetContextFromResource

func SetContextFromResource(ctx context.Context, r MultitenantResource) context.Context

SetContextFromResource takes a context and a multi-tenant resource, adds the namespace to the context, and returns the udpated context

func SilencedFields

func SilencedFields(r Resource) map[string]string

SilencedFields returns a set of fields that represent that resource

func SilencedName

func SilencedName(subscription, check string) (string, error)

SilencedName returns the canonical name 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 SortEntities added in v2.13.0

func SortEntities(entities []*Entity, ordering string, desc bool)

func SortEntitiesByID

func SortEntitiesByID(es []*Entity, asc bool) sort.Interface

SortEntitiesByID can be used to sort a given collection of entities by their IDs.

func SortEntitiesByLastSeen

func SortEntitiesByLastSeen(es []*Entity, asc bool) sort.Interface

SortEntitiesByLastSeen can be used to sort a given collection of entities by last time each was seen.

func SortEntitiesByPredicate

func SortEntitiesByPredicate(es []*Entity, fn func(a, b *Entity) bool) sort.Interface

SortEntitiesByPredicate can be used to sort a given collection using a given predicate.

func SortEventFiltersByName

func SortEventFiltersByName(ef []*EventFilter, asc bool) sort.Interface

SortEventFiltersByName can be used to sort a given collection of event filter by their names.

func SortEventFiltersByPredicate

func SortEventFiltersByPredicate(ef []*EventFilter, fn cmpEventFilter) sort.Interface

SortEventFiltersByPredicate can be used to sort a given collection using a given predicate.

func SortEvents added in v2.13.0

func SortEvents(events []*Event, ordering string, descending bool)

func SortHandlersByName

func SortHandlersByName(hs []*Handler, asc bool) sort.Interface

SortHandlersByName is used to sort a given collection of handlers by their names.

func SortHandlersByPredicate

func SortHandlersByPredicate(hs []*Handler, fn cmpHandler) sort.Interface

SortHandlersByPredicate is used to sort a given collection using a given predicate.

func SortMutatorsByName

func SortMutatorsByName(hs []*Mutator, asc bool) sort.Interface

SortMutatorsByName is used to sort a given collection of mutators by their names.

func SortMutatorsByPredicate

func SortMutatorsByPredicate(hs []*Mutator, fn cmpMutator) sort.Interface

SortMutatorsByPredicate is used to sort a given collection using a given predicate.

func SortSilencedByBegin

func SortSilencedByBegin(es []*Silenced) sort.Interface

SortSilencedByBegin can be used to sort a given collection by their begin timestamp.

func SortSilencedByName

func SortSilencedByName(es []*Silenced) sort.Interface

SortSilencedByName can be used to sort a given collection by their names.

func SortSilencedByPredicate

func SortSilencedByPredicate(es []*Silenced, fn func(a, b *Silenced) bool) sort.Interface

SortSilencedByPredicate can be used to sort a given collection using a given predicate.

func StandardClaims

func StandardClaims(subject string) jwt.StandardClaims

StandardClaims returns an initialized jwt.StandardClaims with the subject

func UserFields

func UserFields(r Resource) map[string]string

UserFields returns a set of fields that represent that resource

func ValidateAssetName

func ValidateAssetName(name string) error

ValidateAssetName validates that asset's name is valid

func ValidateEnvVars

func ValidateEnvVars(vars []string) error

ValidateEnvVars ensures that all the environment variables are well-formed. Vars should be of the form FOO=BAR.

func ValidateInterval

func ValidateInterval(freq uint32) error

ValidateInterval returns an error if the tessen interval is not within the upper and lower bound limits

func ValidateName

func ValidateName(name string) error

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

func ValidateNameStrict(name string) error

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

func ValidateOutputMetricFormat(format string) error

ValidateOutputMetricFormat returns an error if the string is not a valid metric format

func ValidateRoleRef added in v2.2.0

func ValidateRoleRef(roleRef *RoleRef) error

ValidateRoleRef checks that the role reference has a valid reference to either a Role or a ClusterRole

func ValidateSubdues added in v2.14.0

func ValidateSubdues(subdues []*TimeWindowRepeated) error

func ValidateSubscriptionName

func ValidateSubscriptionName(name string) error

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 APIKey

type APIKey struct {
	// Metadata contains the name, namespace (N/A), labels and annotations of
	// the APIKey.
	ObjectMeta `protobuf:"bytes,1,opt,name=metadata,proto3,embedded=metadata" json:"metadata,omitempty"`
	// Username is the username associated with the API key.
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// CreatedAt is a timestamp which the API key was created.
	CreatedAt            int64    `protobuf:"varint,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

An APIKey is an api key specification.

func FixtureAPIKey

func FixtureAPIKey(name string, username string) *APIKey

FixtureAPIKey returns a testing fixture for an APIKey struct.

func NewAPIKeyFromFace

func NewAPIKeyFromFace(that APIKeyFace) *APIKey

func NewPopulatedAPIKey

func NewPopulatedAPIKey(r randyApikey, easy bool) *APIKey

func (*APIKey) Descriptor

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

func (*APIKey) Equal

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

func (*APIKey) Fields added in v2.16.0

func (a *APIKey) Fields() map[string]string

Fields returns a set of fields that represent the resource.

func (*APIKey) GetCreatedAt

func (this *APIKey) GetCreatedAt() int64

func (*APIKey) GetMetadata added in v2.15.0

func (a *APIKey) GetMetadata() *ObjectMeta

func (*APIKey) GetObjectMeta

func (this *APIKey) GetObjectMeta() ObjectMeta

func (*APIKey) GetUsername

func (this *APIKey) GetUsername() string

func (*APIKey) Marshal

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

func (*APIKey) MarshalTo

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

func (*APIKey) MarshalToSizedBuffer

func (m *APIKey) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*APIKey) Proto

func (*APIKey) ProtoMessage

func (*APIKey) ProtoMessage()

func (*APIKey) RBACName

func (*APIKey) RBACName() string

RBACName gets the rbac name of the resource.

func (*APIKey) Reset

func (m *APIKey) Reset()

func (*APIKey) SetMetadata added in v2.15.0

func (a *APIKey) SetMetadata(meta *ObjectMeta)

func (*APIKey) SetNamespace

func (a *APIKey) SetNamespace(namespace string)

SetNamespace sets the namespace of the resource.

func (*APIKey) SetObjectMeta

func (a *APIKey) SetObjectMeta(meta ObjectMeta)

SetObjectMeta sets the meta of the resource.

func (*APIKey) Size

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

func (*APIKey) StoreName added in v2.15.0

func (a *APIKey) StoreName() string

func (*APIKey) StorePrefix

func (a *APIKey) StorePrefix() string

StorePrefix returns the path prefix to this resource in the store.

func (*APIKey) String

func (m *APIKey) String() string

func (*APIKey) TestProto

func (*APIKey) URIPath

func (a *APIKey) URIPath() string

URIPath returns the path component of an api key URI.

func (*APIKey) Unmarshal

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

func (*APIKey) Validate

func (a *APIKey) Validate() error

Validate returns an error if the CheckName and Subscription fields are not provided.

func (*APIKey) XXX_DiscardUnknown

func (m *APIKey) XXX_DiscardUnknown()

func (*APIKey) XXX_Marshal

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

func (*APIKey) XXX_Merge

func (m *APIKey) XXX_Merge(src proto.Message)

func (*APIKey) XXX_Size

func (m *APIKey) XXX_Size() int

func (*APIKey) XXX_Unmarshal

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

type APIKeyFace

type APIKeyFace interface {
	Proto() github_com_golang_protobuf_proto.Message
	GetObjectMeta() ObjectMeta
	GetUsername() string
	GetCreatedAt() int64
}

type AdhocRequest

type AdhocRequest struct {
	// Subscriptions is the list of entity subscriptions.
	Subscriptions []string `protobuf:"bytes,2,rep,name=subscriptions,proto3" 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"`
	// Metadata contains the name, namespace, labels and annotations of the
	// AdhocCheck
	ObjectMeta           `protobuf:"bytes,5,opt,name=metadata,proto3,embedded=metadata" json:"metadata"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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) GetMetadata added in v2.15.0

func (a *AdhocRequest) GetMetadata() *ObjectMeta

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) MarshalTo

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

func (*AdhocRequest) MarshalToSizedBuffer

func (m *AdhocRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AdhocRequest) ProtoMessage

func (*AdhocRequest) ProtoMessage()

func (*AdhocRequest) RBACName

func (a *AdhocRequest) RBACName() string

func (*AdhocRequest) Reset

func (m *AdhocRequest) Reset()

func (*AdhocRequest) SetMetadata added in v2.15.0

func (a *AdhocRequest) SetMetadata(meta *ObjectMeta)

func (*AdhocRequest) SetNamespace

func (a *AdhocRequest) SetNamespace(namespace string)

SetNamespace sets the namespace of the resource.

func (*AdhocRequest) Size

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

func (*AdhocRequest) StoreName added in v2.15.0

func (a *AdhocRequest) StoreName() string

func (*AdhocRequest) StorePrefix

func (a *AdhocRequest) StorePrefix() string

StorePrefix returns the path prefix to this resource in the store

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.

func (*AdhocRequest) XXX_DiscardUnknown

func (m *AdhocRequest) XXX_DiscardUnknown()

func (*AdhocRequest) XXX_Marshal

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

func (*AdhocRequest) XXX_Merge

func (m *AdhocRequest) XXX_Merge(src proto.Message)

func (*AdhocRequest) XXX_Size

func (m *AdhocRequest) XXX_Size() int

func (*AdhocRequest) XXX_Unmarshal

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

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewPopulatedAny

func NewPopulatedAny(r randyAny, easy bool) *Any

func (*Any) Descriptor

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

func (*Any) Equal

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

func (*Any) GetTypeUrl

func (m *Any) GetTypeUrl() string

func (*Any) GetValue

func (m *Any) GetValue() []byte

func (*Any) Marshal

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

func (*Any) MarshalTo

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

func (*Any) MarshalToSizedBuffer

func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Any) ProtoMessage

func (*Any) ProtoMessage()

func (*Any) Reset

func (m *Any) Reset()

func (*Any) Size

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

func (*Any) String

func (m *Any) String() string

func (*Any) Unmarshal

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

func (*Any) XXX_DiscardUnknown

func (m *Any) XXX_DiscardUnknown()

func (*Any) XXX_Marshal

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

func (*Any) XXX_Merge

func (m *Any) XXX_Merge(src proto.Message)

func (*Any) XXX_Size

func (m *Any) XXX_Size() int

func (*Any) XXX_Unmarshal

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

type Asset

type Asset struct {
	// 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"`
	// 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,proto3" json:"filters"`
	// AssetBuilds are a list of one or more assets to install.
	Builds []*AssetBuild `protobuf:"bytes,6,rep,name=builds,proto3" json:"builds"`
	// Metadata contains the name, namespace, labels and annotations of the
	// asset
	ObjectMeta `protobuf:"bytes,8,opt,name=metadata,proto3,embedded=metadata" json:"metadata,omitempty"`
	// Headers is a collection of key/value string pairs used as HTTP headers
	// for asset retrieval.
	Headers              map[string]string `` /* 145-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

Asset defines an asset and optionally a list of assets (builds) that agents install as a dependency for a check, handler, mutator, etc.

func FixtureAsset

func FixtureAsset(name string) *Asset

FixtureAsset given a name returns a valid asset for use in tests

func NewAsset

func NewAsset(meta ObjectMeta) *Asset

NewAsset creates a new Asset.

func NewAssetFromFace

func NewAssetFromFace(that AssetFace) *Asset

func NewPopulatedAsset

func NewPopulatedAsset(r randyAsset, easy bool) *Asset

func (*Asset) Descriptor

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

func (*Asset) Equal

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

func (*Asset) Fields added in v2.16.0

func (a *Asset) Fields() map[string]string

Fields returns a set of fields that represent that resource

func (*Asset) Filename

func (a *Asset) Filename() string

Filename returns the filename of the underlying asset; pulled from the URL

func (*Asset) GetBuilds

func (this *Asset) GetBuilds() []*AssetBuild

func (*Asset) GetFilters

func (this *Asset) GetFilters() []string

func (*Asset) GetHeaders

func (this *Asset) GetHeaders() map[string]string

func (*Asset) GetMetadata added in v2.15.0

func (a *Asset) GetMetadata() *ObjectMeta

func (*Asset) GetObjectMeta

func (this *Asset) GetObjectMeta() ObjectMeta

func (*Asset) GetSha512

func (this *Asset) GetSha512() string

func (*Asset) GetURL

func (this *Asset) GetURL() string

func (*Asset) Marshal

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

func (*Asset) MarshalTo

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

func (*Asset) MarshalToSizedBuffer

func (m *Asset) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Asset) Proto

func (*Asset) ProtoMessage

func (*Asset) ProtoMessage()

func (*Asset) RBACName

func (a *Asset) RBACName() string

func (*Asset) Reset

func (m *Asset) Reset()

func (*Asset) SetMetadata added in v2.15.0

func (a *Asset) SetMetadata(meta *ObjectMeta)

func (*Asset) SetNamespace

func (a *Asset) SetNamespace(namespace string)

SetNamespace sets the namespace of the resource.

func (*Asset) SetObjectMeta

func (a *Asset) SetObjectMeta(meta ObjectMeta)

SetObjectMeta sets the meta of the resource.

func (*Asset) Size

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

func (*Asset) StoreName added in v2.15.0

func (a *Asset) StoreName() string

func (*Asset) StorePrefix

func (a *Asset) StorePrefix() string

StorePrefix returns the path prefix to this resource in the store

func (*Asset) String

func (m *Asset) String() string

func (*Asset) TestProto

func (*Asset) URIPath

func (a *Asset) URIPath() string

URIPath returns the path component of an asset URI.

func (*Asset) Unmarshal

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

func (*Asset) Validate

func (a *Asset) Validate() error

Validate returns an error if the asset contains invalid values.

func (*Asset) XXX_DiscardUnknown

func (m *Asset) XXX_DiscardUnknown()

func (*Asset) XXX_Marshal

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

func (*Asset) XXX_Merge

func (m *Asset) XXX_Merge(src proto.Message)

func (*Asset) XXX_Size

func (m *Asset) XXX_Size() int

func (*Asset) XXX_Unmarshal

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

type AssetBuild

type AssetBuild struct {
	// 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"`
	// 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,proto3" json:"filters"`
	// Headers is a collection of key/value string pairs used as HTTP headers
	// for asset retrieval.
	Headers              map[string]string `` /* 145-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

AssetBuild defines an individual asset that an asset can install as a dependency for a check, handler, mutator, etc.

func NewAssetBuildFromFace

func NewAssetBuildFromFace(that AssetBuildFace) *AssetBuild

func NewPopulatedAssetBuild

func NewPopulatedAssetBuild(r randyAsset, easy bool) *AssetBuild

func (*AssetBuild) Descriptor

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

func (*AssetBuild) Equal

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

func (*AssetBuild) GetFilters

func (this *AssetBuild) GetFilters() []string

func (*AssetBuild) GetHeaders

func (this *AssetBuild) GetHeaders() map[string]string

func (*AssetBuild) GetSha512

func (this *AssetBuild) GetSha512() string

func (*AssetBuild) GetURL

func (this *AssetBuild) GetURL() string

func (*AssetBuild) Marshal

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

func (*AssetBuild) MarshalTo

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

func (*AssetBuild) MarshalToSizedBuffer

func (m *AssetBuild) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AssetBuild) Proto

func (*AssetBuild) ProtoMessage

func (*AssetBuild) ProtoMessage()

func (*AssetBuild) Reset

func (m *AssetBuild) Reset()

func (*AssetBuild) Size

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

func (*AssetBuild) String

func (m *AssetBuild) String() string

func (*AssetBuild) TestProto

func (*AssetBuild) Unmarshal

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

func (*AssetBuild) Validate

func (a *AssetBuild) Validate() error

Validate returns an error if the asset contains invalid values.

func (*AssetBuild) XXX_DiscardUnknown

func (m *AssetBuild) XXX_DiscardUnknown()

func (*AssetBuild) XXX_Marshal

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

func (*AssetBuild) XXX_Merge

func (m *AssetBuild) XXX_Merge(src proto.Message)

func (*AssetBuild) XXX_Size

func (m *AssetBuild) XXX_Size() int

func (*AssetBuild) XXX_Unmarshal

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

type AssetBuildFace

type AssetBuildFace interface {
	Proto() github_com_golang_protobuf_proto.Message
	GetURL() string
	GetSha512() string
	GetFilters() []string
	GetHeaders() map[string]string
}

type AssetFace

type AssetFace interface {
	Proto() github_com_golang_protobuf_proto.Message
	GetURL() string
	GetSha512() string
	GetFilters() []string
	GetBuilds() []*AssetBuild
	GetObjectMeta() ObjectMeta
	GetHeaders() map[string]string
}

type AssetList

type AssetList struct {
	// Assets are a list of assets required to execute check or hook.
	Assets               []Asset  `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

An AssetList represents a list of assets for a CheckRequest.

func NewPopulatedAssetList

func NewPopulatedAssetList(r randyCheck, easy bool) *AssetList

func (*AssetList) Descriptor

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

func (*AssetList) Equal

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

func (*AssetList) GetAssets

func (m *AssetList) GetAssets() []Asset

func (*AssetList) Marshal

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

func (*AssetList) MarshalTo

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

func (*AssetList) MarshalToSizedBuffer

func (m *AssetList) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AssetList) ProtoMessage

func (*AssetList) ProtoMessage()

func (*AssetList) Reset

func (m *AssetList) Reset()

func (*AssetList) Size

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

func (*AssetList) String

func (m *AssetList) String() string

func (*AssetList) Unmarshal

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

func (*AssetList) XXX_DiscardUnknown

func (m *AssetList) XXX_DiscardUnknown()

func (*AssetList) XXX_Marshal

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

func (*AssetList) XXX_Merge

func (m *AssetList) XXX_Merge(src proto.Message)

func (*AssetList) XXX_Size

func (m *AssetList) XXX_Size() int

func (*AssetList) XXX_Unmarshal

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

type AuthProvider

type AuthProvider interface {
	Resource

	// Authenticate attempts to authenticate a user with its username and password
	Authenticate(ctx context.Context, username, password string) (*Claims, error)
	// Refresh renews the user claims with the provider claims
	Refresh(ctx context.Context, claims *Claims) (*Claims, error)

	// Name returns the provider name (e.g. default)
	Name() string
	// Type returns the provider type (e.g. ldap)
	Type() string
}

AuthProvider represents an abstracted authentication provider

type AuthProviderClaims

type AuthProviderClaims struct {
	// ProviderID used to login the user
	ProviderID string `json:"provider_id"`
	// ProviderType represents the type of provider used
	ProviderType string `json:"provider_type"`
	// UserID assigned to the user by the provider
	UserID string `json:"user_id"`
}

AuthProviderClaims contains information from the authentication provider

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

DEPRECATED, DO NOT USE! Events should be ordered FIFO. 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"`
	// Handlers are the event handler for the check (incidents and/or metrics).
	Handlers []string `protobuf:"bytes,3,rep,name=handlers,proto3" 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"`
	// 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,proto3" json:"runtime_assets"`
	// Subscriptions is the list of subscribers for the check.
	Subscriptions []string `protobuf:"bytes,11,rep,name=subscriptions,proto3" json:"subscriptions"`
	// Sources indicates the name of the entity representing an external
	// resource
	ProxyEntityName string `protobuf:"bytes,13,opt,name=proxy_entity_name,json=proxyEntityName,proto3" json:"proxy_entity_name"`
	// CheckHooks is the list of check hooks for the check
	CheckHooks []HookList `protobuf:"bytes,14,rep,name=check_hooks,json=checkHooks,proto3" 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,proto3" 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,proto3" 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,proto3" 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"`
	// 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,proto3" 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,proto3" json:"hooks,omitempty"`
	// OutputMetricFormat 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"`
	// OutputMetricHandlers 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,proto3" 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,proto3" json:"env_vars"`
	// Metadata contains the name, namespace, labels and annotations of the
	// check
	ObjectMeta `protobuf:"bytes,38,opt,name=metadata,proto3,embedded=metadata" json:"metadata,omitempty"`
	// MaxOutputSize is the maximum size in bytes that will be stored for check
	// output. If check output is larger than MaxOutputSize, it will be
	// truncated when stored. Filters, mutators, and handlers will still have
	// access to the full check output at the time the event occurs.
	MaxOutputSize int64 `protobuf:"varint,39,opt,name=max_output_size,json=maxOutputSize,proto3" json:"max_output_size,omitempty"`
	// DiscardOutput causes agents to discard check output. No check output is
	// written to the backend, but metrics extraction is still performed.
	DiscardOutput bool `protobuf:"varint,40,opt,name=discard_output,json=discardOutput,proto3" json:"discard_output,omitempty"`
	// Secrets is the list of Sensu secrets to set for the check's
	// execution environment.
	Secrets []*Secret `protobuf:"bytes,41,rep,name=secrets,proto3" json:"secrets"`
	// IsSilenced indicates whether the check is silenced or not
	IsSilenced bool `protobuf:"varint,42,opt,name=is_silenced,json=isSilenced,proto3" json:"is_silenced"`
	// OutputMetricTags is list of metric tags to apply to metrics extracted from check output.
	OutputMetricTags []*MetricTag `` /* 149-byte string literal not displayed */
	// Scheduler is the type of scheduler the check is scheduled by. The scheduler
	// can be "memory", "etcd", or "postgres". Scheduler is set by Sensu - any
	// setting by the user will be overridden.
	Scheduler string `protobuf:"bytes,44,opt,name=scheduler,proto3" json:"scheduler"`
	// ProcessedBy indicates the name of the agent that processed the event. This
	// is mainly useful for determining which agent executed a proxy check request.
	ProcessedBy string `protobuf:"bytes,45,opt,name=ProcessedBy,proto3" json:"processed_by,omitempty" yaml: "processed_by"`
	// Pipelines are the pipelines this check will use to process its events.
	Pipelines []*ResourceReference `protobuf:"bytes,46,rep,name=pipelines,proto3" json:"pipelines"`
	// MetricThresholds are a list of thresholds to apply to metrics in order to determine
	// the check status.
	OutputMetricThresholds []*MetricThreshold    `` /* 173-byte string literal not displayed */
	Subdues                []*TimeWindowRepeated `protobuf:"bytes,48,rep,name=subdues,proto3" json:"subdues,omitempty"`
	// ExtendedAttributes store serialized arbitrary JSON-encoded data
	ExtendedAttributes   []byte   `protobuf:"bytes,99,opt,name=ExtendedAttributes,proto3" json:"-"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A Check is a check specification and optionally the results of the check's execution.

func FixtureCheck

func FixtureCheck(id string) *Check

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 NewCheckFromFace

func NewCheckFromFace(that CheckFace) *Check

func NewPopulatedCheck

func NewPopulatedCheck(r randyCheck, easy bool) *Check

func (*Check) Descriptor

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

func (*Check) Equal

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

func (*Check) GetCheckHooks

func (this *Check) GetCheckHooks() []HookList

func (*Check) GetCommand

func (this *Check) GetCommand() string

func (*Check) GetCron

func (this *Check) GetCron() string

func (*Check) GetDiscardOutput

func (this *Check) GetDiscardOutput() bool

func (*Check) GetDuration

func (this *Check) GetDuration() float64

func (*Check) GetEnvVars

func (this *Check) GetEnvVars() []string

func (*Check) GetExecuted

func (this *Check) GetExecuted() int64

func (*Check) GetExtendedAttributes

func (this *Check) GetExtendedAttributes() []byte

func (*Check) GetHandlers

func (this *Check) GetHandlers() []string

func (*Check) GetHighFlapThreshold

func (this *Check) GetHighFlapThreshold() uint32

func (*Check) GetHistory

func (this *Check) GetHistory() []CheckHistory

func (*Check) GetHooks

func (this *Check) GetHooks() []*Hook

func (*Check) GetInterval

func (this *Check) GetInterval() uint32

func (*Check) GetIsSilenced added in v2.2.0

func (this *Check) GetIsSilenced() bool

func (*Check) GetIssued

func (this *Check) GetIssued() int64

func (*Check) GetLastOK

func (this *Check) GetLastOK() int64

func (*Check) GetLowFlapThreshold

func (this *Check) GetLowFlapThreshold() uint32

func (*Check) GetMaxOutputSize

func (this *Check) GetMaxOutputSize() int64

func (*Check) GetMetadata added in v2.15.0

func (c *Check) GetMetadata() *ObjectMeta

func (*Check) GetObjectMeta

func (this *Check) GetObjectMeta() ObjectMeta

func (*Check) GetOccurrences

func (this *Check) GetOccurrences() int64

func (*Check) GetOccurrencesWatermark

func (this *Check) GetOccurrencesWatermark() int64

func (*Check) GetOutput

func (this *Check) GetOutput() string

func (*Check) GetOutputMetricFormat

func (this *Check) GetOutputMetricFormat() string

func (*Check) GetOutputMetricHandlers

func (this *Check) GetOutputMetricHandlers() []string

func (*Check) GetOutputMetricTags added in v2.3.0

func (this *Check) GetOutputMetricTags() []*MetricTag

func (*Check) GetOutputMetricThresholds added in v2.14.0

func (this *Check) GetOutputMetricThresholds() []*MetricThreshold

func (*Check) GetPipelines added in v2.10.0

func (this *Check) GetPipelines() []*ResourceReference

func (*Check) GetProcessedBy added in v2.10.0

func (this *Check) GetProcessedBy() string

func (*Check) GetProxyEntityName

func (this *Check) GetProxyEntityName() string

func (*Check) GetProxyRequests

func (this *Check) GetProxyRequests() *ProxyRequests

func (*Check) GetPublish

func (this *Check) GetPublish() bool

func (*Check) GetRoundRobin

func (this *Check) GetRoundRobin() bool

func (*Check) GetRuntimeAssets

func (this *Check) GetRuntimeAssets() []string

func (*Check) GetScheduler added in v2.5.0

func (this *Check) GetScheduler() string

func (*Check) GetSecrets

func (this *Check) GetSecrets() []*Secret

func (*Check) GetSilenced

func (this *Check) GetSilenced() []string

func (*Check) GetState

func (this *Check) GetState() string

func (*Check) GetStatus

func (this *Check) GetStatus() uint32

func (*Check) GetStdin

func (this *Check) GetStdin() bool

func (*Check) GetSubdue

func (this *Check) GetSubdue() *TimeWindowWhen

func (*Check) GetSubdues added in v2.14.0

func (this *Check) GetSubdues() []*TimeWindowRepeated

func (*Check) GetSubscriptions

func (this *Check) GetSubscriptions() []string

func (*Check) GetTimeout

func (this *Check) GetTimeout() uint32

func (*Check) GetTotalStateChange

func (this *Check) GetTotalStateChange() uint32

func (*Check) GetTtl

func (this *Check) GetTtl() int64

func (*Check) Marshal

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

func (*Check) MarshalJSON

func (c *Check) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Check) MarshalTo

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

func (*Check) MarshalToSizedBuffer

func (m *Check) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Check) MergeWith

func (c *Check) MergeWith(prevCheck *Check)

MergeWith updates the current Check with the history of the check given as an argument, updating the current check's history appropriately.

func (*Check) Proto

func (*Check) ProtoMessage

func (*Check) ProtoMessage()

func (*Check) RBACName

func (c *Check) RBACName() string

func (*Check) Reset

func (m *Check) Reset()

func (*Check) SetMetadata added in v2.15.0

func (c *Check) SetMetadata(meta *ObjectMeta)

func (*Check) SetName

func (c *Check) SetName(name string)

SetName sets the name of the resource.

func (*Check) SetNamespace

func (c *Check) SetNamespace(namespace string)

SetNamespace sets the namespace of the resource.

func (*Check) SetObjectMeta

func (c *Check) SetObjectMeta(meta ObjectMeta)

SetObjectMeta sets the meta of the resource.

func (*Check) Size

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

func (*Check) StoreName added in v2.15.0

func (c *Check) StoreName() string

func (*Check) StorePrefix

func (c *Check) StorePrefix() string

StorePrefix returns the path prefix to this resource in the store

func (*Check) String

func (m *Check) String() string

func (*Check) TestProto

func (*Check) URIPath

func (c *Check) URIPath() string

URIPath returns the path component of a check URI.

func (*Check) Unmarshal

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

func (*Check) Validate

func (c *Check) Validate() error

Validate returns an error if the check does not pass validation tests.

func (*Check) XXX_DiscardUnknown

func (m *Check) XXX_DiscardUnknown()

func (*Check) XXX_Marshal

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

func (*Check) XXX_Merge

func (m *Check) XXX_Merge(src proto.Message)

func (*Check) XXX_Size

func (m *Check) XXX_Size() int

func (*Check) XXX_Unmarshal

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

type CheckConfig

type CheckConfig struct {
	// Command is the command to be executed.
	Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	// Handlers are the event handler for the check (incidents and/or metrics).
	Handlers []string `protobuf:"bytes,3,rep,name=handlers,proto3" 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"`
	// 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,proto3" json:"runtime_assets"`
	// Subscriptions is the list of subscribers for the check.
	Subscriptions []string `protobuf:"bytes,11,rep,name=subscriptions,proto3" 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
	ProxyEntityName string `protobuf:"bytes,13,opt,name=proxy_entity_name,json=proxyEntityName,proto3" json:"proxy_entity_name"`
	// CheckHooks is the list of check hooks for the check
	CheckHooks []HookList `protobuf:"bytes,14,rep,name=check_hooks,json=checkHooks,proto3" 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,proto3" 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,proto3" 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,proto3" 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,proto3" json:"env_vars"`
	// Metadata contains the name, namespace, labels and annotations of the
	// check
	ObjectMeta `protobuf:"bytes,26,opt,name=metadata,proto3,embedded=metadata" json:"metadata,omitempty"`
	// MaxOutputSize is the maximum size in bytes that will be stored for check
	// output. If check output is larger than MaxOutputSize, it will be
	// truncated when stored. Filters, mutators, and handlers will still have
	// access to the full check output at the time the event occurs.
	MaxOutputSize int64 `protobuf:"varint,27,opt,name=max_output_size,json=maxOutputSize,proto3" json:"max_output_size,omitempty"`
	// DiscardOutput causes agents to discard check output. No check output is
	// written to the backend, but metrics extraction is still performed.
	DiscardOutput bool `protobuf:"varint,28,opt,name=discard_output,json=discardOutput,proto3" json:"discard_output,omitempty"`
	// Secrets is the list of Sensu secrets to set for the check's
	// execution environment.
	Secrets []*Secret `protobuf:"bytes,29,rep,name=secrets,proto3" json:"secrets"`
	// OutputMetricTags is list of metric tags to apply to metrics extracted from check output.
	OutputMetricTags []*MetricTag `` /* 149-byte string literal not displayed */
	// Scheduler is the type of scheduler the check is scheduled by. The scheduler
	// can be "memory", "etcd", or "postgres". Scheduler is set by Sensu - any
	// setting by the user will be overridden.
	Scheduler string `protobuf:"bytes,31,opt,name=scheduler,proto3" json:"-" yaml: "-"`
	// Pipelines are the pipelines this check will use to process its events.
	Pipelines              []*ResourceReference  `protobuf:"bytes,32,rep,name=pipelines,proto3" json:"pipelines"`
	OutputMetricThresholds []*MetricThreshold    `` /* 173-byte string literal not displayed */
	Subdues                []*TimeWindowRepeated `protobuf:"bytes,34,rep,name=subdues,proto3" json:"subdues,omitempty"`
	XXX_NoUnkeyedLiteral   struct{}              `json:"-"`
	XXX_unrecognized       []byte                `json:"-"`
	XXX_sizecache          int32                 `json:"-"`
}

CheckConfig is the specification of a check.

func FixtureCheckConfig

func FixtureCheckConfig(id string) *CheckConfig

FixtureCheckConfig returns a fixture for a CheckConfig object.

func NewCheckConfig

func NewCheckConfig(meta ObjectMeta) *CheckConfig

NewCheckConfig creates a new CheckConfig.

func NewCheckConfigFromFace

func NewCheckConfigFromFace(that CheckConfigFace) *CheckConfig

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) Fields added in v2.16.0

func (c *CheckConfig) Fields() map[string]string

CheckConfigFields returns a set of fields that represent that resource

func (*CheckConfig) GetCheckHooks

func (this *CheckConfig) GetCheckHooks() []HookList

func (*CheckConfig) GetCommand

func (this *CheckConfig) GetCommand() string

func (*CheckConfig) GetCron

func (this *CheckConfig) GetCron() string

func (*CheckConfig) GetDiscardOutput

func (this *CheckConfig) GetDiscardOutput() bool

func (*CheckConfig) GetEnvVars

func (this *CheckConfig) GetEnvVars() []string

func (*CheckConfig) GetExtendedAttributes

func (this *CheckConfig) GetExtendedAttributes() []byte

func (*CheckConfig) GetHandlers

func (this *CheckConfig) GetHandlers() []string

func (*CheckConfig) GetHighFlapThreshold

func (this *CheckConfig) GetHighFlapThreshold() uint32

func (*CheckConfig) GetInterval

func (this *CheckConfig) GetInterval() uint32

func (*CheckConfig) GetLowFlapThreshold

func (this *CheckConfig) GetLowFlapThreshold() uint32

func (*CheckConfig) GetMaxOutputSize

func (this *CheckConfig) GetMaxOutputSize() int64

func (*CheckConfig) GetMetadata added in v2.15.0

func (c *CheckConfig) GetMetadata() *ObjectMeta

func (*CheckConfig) GetObjectMeta

func (this *CheckConfig) GetObjectMeta() ObjectMeta

func (*CheckConfig) GetOutputMetricFormat

func (this *CheckConfig) GetOutputMetricFormat() string

func (*CheckConfig) GetOutputMetricHandlers

func (this *CheckConfig) GetOutputMetricHandlers() []string

func (*CheckConfig) GetOutputMetricTags added in v2.3.0

func (this *CheckConfig) GetOutputMetricTags() []*MetricTag

func (*CheckConfig) GetOutputMetricThresholds added in v2.14.0

func (this *CheckConfig) GetOutputMetricThresholds() []*MetricThreshold

func (*CheckConfig) GetPipelines added in v2.10.0

func (this *CheckConfig) GetPipelines() []*ResourceReference

func (*CheckConfig) GetProxyEntityName

func (this *CheckConfig) GetProxyEntityName() string

func (*CheckConfig) GetProxyRequests

func (this *CheckConfig) GetProxyRequests() *ProxyRequests

func (*CheckConfig) GetPublish

func (this *CheckConfig) GetPublish() bool

func (*CheckConfig) GetRoundRobin

func (this *CheckConfig) GetRoundRobin() bool

func (*CheckConfig) GetRuntimeAssets

func (this *CheckConfig) GetRuntimeAssets() []string

func (*CheckConfig) GetScheduler added in v2.5.0

func (this *CheckConfig) GetScheduler() string

func (*CheckConfig) GetSecrets

func (this *CheckConfig) GetSecrets() []*Secret

func (*CheckConfig) GetStdin

func (this *CheckConfig) GetStdin() bool

func (*CheckConfig) GetSubdue

func (this *CheckConfig) GetSubdue() *TimeWindowWhen

func (*CheckConfig) GetSubdues added in v2.14.0

func (this *CheckConfig) GetSubdues() []*TimeWindowRepeated

func (*CheckConfig) GetSubscriptions

func (this *CheckConfig) GetSubscriptions() []string

func (*CheckConfig) GetTimeout

func (this *CheckConfig) GetTimeout() uint32

func (*CheckConfig) GetTtl

func (this *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) MarshalTo

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

func (*CheckConfig) MarshalToSizedBuffer

func (m *CheckConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CheckConfig) Proto

func (*CheckConfig) ProtoMessage

func (*CheckConfig) ProtoMessage()

func (*CheckConfig) RBACName

func (c *CheckConfig) RBACName() string

func (*CheckConfig) Reset

func (m *CheckConfig) Reset()

func (*CheckConfig) SetMetadata added in v2.15.0

func (c *CheckConfig) SetMetadata(meta *ObjectMeta)

func (*CheckConfig) SetNamespace

func (c *CheckConfig) SetNamespace(namespace string)

SetNamespace sets the namespace of the resource.

func (*CheckConfig) SetObjectMeta

func (c *CheckConfig) SetObjectMeta(meta ObjectMeta)

SetObjectMeta sets the meta of the resource.

func (*CheckConfig) Size

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

func (*CheckConfig) StoreName added in v2.15.0

func (c *CheckConfig) StoreName() string

func (*CheckConfig) StorePrefix

func (c *CheckConfig) StorePrefix() string

StorePrefix returns the path prefix to this resource in the store

func (*CheckConfig) String

func (m *CheckConfig) String() string

func (*CheckConfig) TestProto

func (*CheckConfig) URIPath