types

package module
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 10 Imported by: 655

Documentation

Index

Constants

View Source
const (
	// AccessTokenString is the key name used to retrieve the access token string
	AccessTokenString = v2.AccessTokenString

	// AccessTokenClaims contains the key name to retrieve the access token claims
	AccessTokenClaims = v2.AccessTokenClaims

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

	// NamespaceKey contains the key name to retrieve the namespace from context
	NamespaceKey = v2.NamespaceKey

	// PageContinueKey contains the continue token used in pagination
	PageContinueKey = v2.PageContinueKey

	// PageSizeKey contains the page size used in pagination
	PageSizeKey = v2.PageSizeKey

	// RefreshTokenClaims contains the key name to retrieve the refresh token claims
	RefreshTokenClaims = v2.RefreshTokenClaims

	// RefreshTokenString contains the key name to retrieve the refresh token string
	RefreshTokenString = v2.RefreshTokenString

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

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

	// ResourceAll represents all possible resources
	ResourceAll = v2.ResourceAll

	// VerbAll represents all possible verbs
	VerbAll = v2.VerbAll

	// GroupType represents a group object in a subject
	GroupType = v2.GroupType

	// UserType represents a user object in a subject
	UserType = v2.UserType

	// LocalSelfUserResource represents a local user trying to view itself
	// or change its password
	LocalSelfUserResource = v2.LocalSelfUserResource

	// HandlerPipeType represents handlers that pipes event data // into arbitrary
	// commands via STDIN
	HandlerPipeType = v2.HandlerPipeType

	// HandlerSetType represents handlers that groups event handlers, making it
	// easy to manage groups of actions that should be executed for certain v2
	// of events.
	HandlerSetType = v2.HandlerSetType

	// HandlerTCPType represents handlers that send event data to a remote TCP
	// socket
	HandlerTCPType = v2.HandlerTCPType

	// HandlerUDPType represents handlers that send event data to a remote UDP
	// socket
	HandlerUDPType = v2.HandlerUDPType

	// HandlerGRPCType is a special kind of handler that represents an extension
	HandlerGRPCType = v2.HandlerGRPCType

	// EventFilterActionAllow is an action to allow events to pass through to the pipeline
	EventFilterActionAllow = v2.EventFilterActionAllow

	// EventFilterActionDeny is an action to deny events from passing through to the pipeline
	EventFilterActionDeny = v2.EventFilterActionDeny

	// DefaultEventFilterAction is the default action for filters
	DefaultEventFilterAction = v2.DefaultEventFilterAction

	// EntityAgentClass is the name of the class given to agent entities.
	EntityAgentClass = v2.EntityAgentClass

	// EntityProxyClass is the name of the class given to proxy entities.
	EntityProxyClass = v2.EntityProxyClass

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

	// Redacted is filled in for fields that contain sensitive information
	Redacted = v2.Redacted

	EventFailingState = v2.EventFailingState

	// EventFlappingState indicates a rapid change in check result status
	EventFlappingState = v2.EventFlappingState

	// EventPassingState indicates successful check result status
	EventPassingState = v2.EventPassingState

	// CheckRequestType is the message type string for check request.
	CheckRequestType = v2.CheckRequestType

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

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

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

	// OpenTSDBOutputMetricFormat is the accepted string to represent the output metric format of
	// OpenTSDB Line
	OpenTSDBOutputMetricFormat = v2.OpenTSDBOutputMetricFormat

	// InfluxDBOutputMetricFormat is the accepted string to represent the output metric format of
	// InfluxDB Line
	InfluxDBOutputMetricFormat = v2.InfluxDBOutputMetricFormat

	// CoreEdition represents the Sensu Core Edition (CE)
	CoreEdition = v2.CoreEdition

	// EditionHeader represents the HTTP header containing the edition value
	EditionHeader = v2.EditionHeader

	// NamespaceTypeAll matches all actions
	NamespaceTypeAll = v2.NamespaceTypeAll

	DefaultKeepaliveTimeout = v2.DefaultKeepaliveTimeout
)

Variables

View Source
var (
	FixtureCheckRequest       = v2.FixtureCheckRequest
	FixtureCheckConfig        = v2.FixtureCheckConfig
	FixtureCheck              = v2.FixtureCheck
	FixtureProxyRequests      = v2.FixtureProxyRequests
	FixtureNamespace          = v2.FixtureNamespace
	FixtureMetrics            = v2.FixtureMetrics
	FixtureMetricPoint        = v2.FixtureMetricPoint
	FixtureMetricTag          = v2.FixtureMetricTag
	FixtureHandler            = v2.FixtureHandler
	FixtureSocketHandler      = v2.FixtureSocketHandler
	FixtureSetHandler         = v2.FixtureSetHandler
	FixtureUser               = v2.FixtureUser
	FixtureHealthResponse     = v2.FixtureHealthResponse
	FixtureEvent              = v2.FixtureEvent
	FixtureEventFilter        = v2.FixtureEventFilter
	FixtureDenyEventFilter    = v2.FixtureDenyEventFilter
	FixtureExtension          = v2.FixtureExtension
	FixtureMutator            = v2.FixtureMutator
	FixtureAsset              = v2.FixtureAsset
	FixtureSubject            = v2.FixtureSubject
	FixtureRule               = v2.FixtureRule
	FixtureRole               = v2.FixtureRole
	FixtureRoleRef            = v2.FixtureRoleRef
	FixtureRoleBinding        = v2.FixtureRoleBinding
	FixtureClusterRole        = v2.FixtureClusterRole
	FixtureClusterRoleBinding = v2.FixtureClusterRoleBinding
	FixtureEntity             = v2.FixtureEntity
	FixtureHookConfig         = v2.FixtureHookConfig
	FixtureHook               = v2.FixtureHook
	FixtureHookList           = v2.FixtureHookList
	FixtureSilenced           = v2.FixtureSilenced
	FixtureAdhocRequest       = v2.FixtureAdhocRequest
	FixtureTokens             = v2.FixtureTokens
)

Test fixture

View Source
var (
	SetContextFromResource      = v2.SetContextFromResource
	NewKeepaliveRecord          = v2.NewKeepaliveRecord
	GetEntitySubscription       = v2.GetEntitySubscription
	OutputMetricFormats         = v2.OutputMetricFormats
	ContextNamespace            = v2.ContextNamespace
	NewCheck                    = v2.NewCheck
	CommonCoreResources         = v2.CommonCoreResources
	SilencedName                = v2.SilencedName
	FakeHandlerCommand          = v2.FakeHandlerCommand
	FakeMutatorCommand          = v2.FakeMutatorCommand
	ValidateName                = v2.ValidateName
	SortCheckConfigsByPredicate = v2.SortCheckConfigsByPredicate
	SortCheckConfigsByName      = v2.SortCheckConfigsByName
	SortEntitiesByPredicate     = v2.SortEntitiesByPredicate
	SortEntitiesByID            = v2.SortEntitiesByID
	SortEntitiesByLastSeen      = v2.SortEntitiesByLastSeen
	SortEventFiltersByPredicate = v2.SortEventFiltersByPredicate
	SortEventFiltersByName      = v2.SortEventFiltersByName
	SortHandlersByPredicate     = v2.SortHandlersByPredicate
	SortHandlersByName          = v2.SortHandlersByName
	SortSilencedByPredicate     = v2.SortSilencedByPredicate
	SortSilencedByName          = v2.SortSilencedByName
	SortSilencedByBegin         = v2.SortSilencedByBegin
	DefaultRedactFields         = v2.DefaultRedactFields
	EventsBySeverity            = v2.EventsBySeverity
	EventsByTimestamp           = v2.EventsByTimestamp
	EventsByLastOk              = v2.EventsByLastOk
	EventFilterAllActions       = v2.EventFilterAllActions
	ValidateOutputMetricFormat  = v2.ValidateOutputMetricFormat
)

Misc functions and vars

View Source
var ErrAPINotFound = errors.New("api not found")

Functions

func ApiVersion

func ApiVersion(version string) string

func RegisterResolver added in v0.2.0

func RegisterResolver(key string, resolver func(string) (interface{}, error))

RegisterResolver adds a package to packageMap with its resolver.

func RegisterTypeResolver

func RegisterTypeResolver(key string, resolver func(string) (Resource, error))

RegisterTypeResolver adds a package to packageMap with its resolver. Deprecated.

func ResolveRaw added in v0.2.0

func ResolveRaw(apiVersion string, typename string) (interface{}, error)

ResolveRaw resolves the raw type for the requested type.

Types

type AdhocRequest

type AdhocRequest = v2.AdhocRequest

type Asset

type Asset = v2.Asset

type ByExecuted

type ByExecuted = v2.ByExecuted

type Check

type Check = v2.Check

type CheckConfig

type CheckConfig = v2.CheckConfig

type CheckHistory

type CheckHistory = v2.CheckHistory

type CheckRequest

type CheckRequest = v2.CheckRequest

type Claims

type Claims = v2.Claims

type ClusterHealth

type ClusterHealth = v2.ClusterHealth

type ClusterRole

type ClusterRole = v2.ClusterRole

type ClusterRoleBinding

type ClusterRoleBinding = v2.ClusterRoleBinding

type ConstrainedResource

type ConstrainedResource = v2.ConstrainedResource

type Deregistration

type Deregistration = v2.Deregistration

type Entity

type Entity = v2.Entity

type Event

type Event = v2.Event

type EventFilter

type EventFilter = v2.EventFilter

type Extension

type Extension = v2.Extension

type Handler

type Handler = v2.Handler

type HandlerSocket

type HandlerSocket = v2.HandlerSocket

type HealthResponse

type HealthResponse = v2.HealthResponse

type Hook

type Hook = v2.Hook

type HookConfig

type HookConfig = v2.HookConfig

type HookList

type HookList = v2.HookList

type KeepaliveRecord

type KeepaliveRecord = v2.KeepaliveRecord

type MetricPoint

type MetricPoint = v2.MetricPoint

type MetricTag

type MetricTag = v2.MetricTag

type Metrics

type Metrics = v2.Metrics

type MultitenantResource

type MultitenantResource = v2.MultitenantResource

type Mutator

type Mutator = v2.Mutator

type Namespace

type Namespace = v2.Namespace

type Network

type Network = v2.Network

type NetworkInterface

type NetworkInterface = v2.NetworkInterface

type ObjectMeta

type ObjectMeta = v2.ObjectMeta

type ProxyRequests

type ProxyRequests = v2.ProxyRequests

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

type QueueGetter interface {
	GetQueue(path ...string) Queue
}

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 = v2.Resource

func ResolveType

func ResolveType(apiVersion string, typename string) (Resource, error)

ResolveType returns the Resource associated with the given package and type.

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

Ring is the interface of a ring. Ring's methods are atomic and goroutine-safe.

type RingGetter

type RingGetter interface {
	// GetRing gets a named Ring.
	GetRing(path ...string) Ring
}

RingGetter provides a way to get a Ring.

type Role

type Role = v2.Role

type RoleBinding

type RoleBinding = v2.RoleBinding

type RoleRef

type RoleRef = v2.RoleRef

type Rule

type Rule = v2.Rule

type Silenced

type Silenced = v2.Silenced

type Subject

type Subject = v2.Subject

type System

type System = v2.System

type TLSOptions

type TLSOptions = v2.TLSOptions

type TimeWindowDays

type TimeWindowDays = v2.TimeWindowDays

type TimeWindowTimeRange

type TimeWindowTimeRange = v2.TimeWindowTimeRange

type TimeWindowWhen

type TimeWindowWhen = v2.TimeWindowWhen

type Tokens

type Tokens = v2.Tokens

type TypeMeta

type TypeMeta = v2.TypeMeta

type User

type User = v2.User

type Wrapper

type Wrapper struct {
	TypeMeta

	ObjectMeta ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`

	// Value is a valid Resource of concrete type Type.
	Value interface{} `json:"spec" yaml:"spec"`
}

Wrapper is a generic wrapper, with a type field for distinguishing its contents.

func WrapResource

func WrapResource(r Resource) Wrapper

WrapResource wraps a Resource in a Wrapper that contains TypeMeta and ObjectMeta.

func (Wrapper) MarshalJSON

func (w Wrapper) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (Wrapper) MarshalYAML

func (w Wrapper) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler

func (*Wrapper) UnmarshalJSON

func (w *Wrapper) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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