Documentation
¶
Index ¶
- Constants
- Variables
- func APIKeyFields(r Resource) map[string]string
- func AssetFields(r Resource) map[string]string
- func CheckConfigFields(r Resource) map[string]string
- func ClusterRoleBindingFields(r Resource) map[string]string
- func ClusterRoleFields(r Resource) map[string]string
- func EntityFields(r Resource) map[string]string
- func EventFields(r Resource) map[string]string
- func EventFilterFields(r Resource) map[string]string
- func HandlerFields(r Resource) map[string]string
- func HookConfigFields(r Resource) map[string]string
- func MergeMapWithPrefix(a map[string]string, b map[string]string, prefix string)
- func MutatorFields(r Resource) map[string]string
- func NamespaceFields(r Resource) map[string]string
- func PipelineFields(r Resource) map[string]string
- func RoleBindingFields(r Resource) map[string]string
- func RoleFields(r Resource) map[string]string
- func SilencedFields(r Resource) map[string]string
- func UserFields(r Resource) map[string]string
- func V2EntityToV3(e *corev2.Entity) (*EntityConfig, *EntityState)
- func V3EntityToV2(cfg *EntityConfig, state *EntityState) (*corev2.Entity, error)
- func V3NamespaceToV2(n *Namespace) *corev2.Namespace
- func V3ToV2Resource(resource Resource) corev2.Resource
- func ValidateGlobalMetadata(meta *corev2.ObjectMeta) error
- func ValidateMetadata(meta *corev2.ObjectMeta) error
- type AuthProvider
- type ClusterConfig
- func (c *ClusterConfig) GetMetadata() *corev2.ObjectMeta
- func (c *ClusterConfig) GetTypeMeta() corev2.TypeMeta
- func (c *ClusterConfig) RBACName() string
- func (c *ClusterConfig) SetMetadata(meta *corev2.ObjectMeta)
- func (c *ClusterConfig) StoreName() string
- func (c *ClusterConfig) URIPath() string
- func (c *ClusterConfig) UnmarshalJSON(msg []byte) error
- func (c *ClusterConfig) Validate() error
- type Deregistration
- type EntityConfig
- func (*EntityConfig) Descriptor() ([]byte, []int)
- func (this *EntityConfig) Equal(that interface{}) bool
- func (e *EntityConfig) Fields() map[string]string
- func (m *EntityConfig) GetDeregister() bool
- func (m *EntityConfig) GetDeregistration() v2.Deregistration
- func (m *EntityConfig) GetEntityClass() string
- func (m *EntityConfig) GetKeepaliveHandlers() []string
- func (m *EntityConfig) GetMetadata() *v2.ObjectMeta
- func (m *EntityConfig) GetRedact() []string
- func (m *EntityConfig) GetSubscriptions() []string
- func (e *EntityConfig) GetTypeMeta() corev2.TypeMeta
- func (m *EntityConfig) GetUser() string
- func (m *EntityConfig) Marshal() (dAtA []byte, err error)
- func (m *EntityConfig) MarshalTo(dAtA []byte) (int, error)
- func (m *EntityConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (e *EntityConfig) ProduceRedacted() Resource
- func (*EntityConfig) ProtoMessage()
- func (e *EntityConfig) RBACName() string
- func (m *EntityConfig) Reset()
- func (e *EntityConfig) SetMetadata(meta *corev2.ObjectMeta)
- func (m *EntityConfig) Size() (n int)
- func (e *EntityConfig) StoreName() string
- func (m *EntityConfig) String() string
- func (e *EntityConfig) URIPath() string
- func (m *EntityConfig) Unmarshal(dAtA []byte) error
- func (e *EntityConfig) UnmarshalJSON(msg []byte) error
- func (e *EntityConfig) Validate() error
- func (m *EntityConfig) XXX_DiscardUnknown()
- func (m *EntityConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EntityConfig) XXX_Merge(src proto.Message)
- func (m *EntityConfig) XXX_Size() int
- func (m *EntityConfig) XXX_Unmarshal(b []byte) error
- type EntityState
- func (*EntityState) Descriptor() ([]byte, []int)
- func (this *EntityState) Equal(that interface{}) bool
- func (e *EntityState) Fields() map[string]string
- func (m *EntityState) GetLastSeen() int64
- func (m *EntityState) GetMetadata() *v2.ObjectMeta
- func (m *EntityState) GetSensuAgentVersion() string
- func (m *EntityState) GetSystem() v2.System
- func (e *EntityState) GetTypeMeta() corev2.TypeMeta
- func (m *EntityState) Marshal() (dAtA []byte, err error)
- func (m *EntityState) MarshalTo(dAtA []byte) (int, error)
- func (m *EntityState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EntityState) ProtoMessage()
- func (e *EntityState) RBACName() string
- func (m *EntityState) Reset()
- func (e *EntityState) SetMetadata(meta *corev2.ObjectMeta)
- func (m *EntityState) Size() (n int)
- func (e *EntityState) StoreName() string
- func (m *EntityState) String() string
- func (e *EntityState) URIPath() string
- func (m *EntityState) Unmarshal(dAtA []byte) error
- func (e *EntityState) UnmarshalJSON(msg []byte) error
- func (e *EntityState) Validate() error
- func (m *EntityState) XXX_DiscardUnknown()
- func (m *EntityState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EntityState) XXX_Merge(src proto.Message)
- func (m *EntityState) XXX_Size() int
- func (m *EntityState) XXX_Unmarshal(b []byte) error
- type Fielder
- type GeneratedType
- type GlobalResource
- type Namespace
- func (n *Namespace) GetMetadata() *corev2.ObjectMeta
- func (n *Namespace) GetTypeMeta() corev2.TypeMeta
- func (n *Namespace) IsGlobalResource() bool
- func (n *Namespace) RBACName() string
- func (n *Namespace) SetMetadata(meta *corev2.ObjectMeta)
- func (n *Namespace) StoreName() string
- func (n *Namespace) URIPath() string
- func (n *Namespace) UnmarshalJSON(msg []byte) error
- func (n *Namespace) Validate() error
- type Network
- type NetworkInterface
- type Process
- type Redacter
- type Resource
- type ResourceTemplate
- func (r *ResourceTemplate) Execute(meta *corev2.ObjectMeta) (Resource, error)
- func (r *ResourceTemplate) GetMetadata() *corev2.ObjectMeta
- func (r *ResourceTemplate) GetTypeMeta() corev2.TypeMeta
- func (r *ResourceTemplate) RBACName() string
- func (r *ResourceTemplate) SetMetadata(meta *corev2.ObjectMeta)
- func (r *ResourceTemplate) StoreName() string
- func (r *ResourceTemplate) URIPath() string
- func (r *ResourceTemplate) UnmarshalJSON(msg []byte) error
- func (r *ResourceTemplate) Validate() error
- type SymmetricKey
- func (s *SymmetricKey) GetMetadata() *corev2.ObjectMeta
- func (s *SymmetricKey) GetTypeMeta() corev2.TypeMeta
- func (s *SymmetricKey) RBACName() string
- func (s *SymmetricKey) SetMetadata(meta *corev2.ObjectMeta)
- func (s *SymmetricKey) StoreName() string
- func (s *SymmetricKey) URIPath() string
- func (s *SymmetricKey) UnmarshalJSON(msg []byte) error
- func (s *SymmetricKey) Validate() error
- type System
- type V2ResourceProxy
- func (v *V2ResourceProxy) GetObjectMeta() corev2.ObjectMeta
- func (v V2ResourceProxy) GetTypeMeta() corev2.TypeMeta
- func (v V2ResourceProxy) MarshalJSON() ([]byte, error)
- func (v *V2ResourceProxy) SetNamespace(ns string)
- func (v *V2ResourceProxy) SetObjectMeta(meta corev2.ObjectMeta)
- func (v *V2ResourceProxy) StorePrefix() string
- func (v *V2ResourceProxy) UnmarshalJSON(b []byte) error
Constants ¶
const ( // EntityNotFound is used to indicate that an entity was not found between // agentd and the agent // TODO(palourde): figure out a better way to express that than relying on a // special entity name EntityNotFound = "not found" )
const (
NamespaceSortName = "NAME"
)
Variables ¶
Functions ¶
func APIKeyFields ¶
APIKeyFields returns a set of fields that represent that resource.
func AssetFields ¶
AssetFields returns a set of fields that represent that resource
func CheckConfigFields ¶
CheckConfigFields returns a set of fields that represent that resource
func ClusterRoleBindingFields ¶
ClusterRoleBindingFields returns a set of fields that represent that resource
func ClusterRoleFields ¶
ClusterRoleFields returns a set of fields that represent that resource
func EntityFields ¶
EntityFields returns a set of fields that represent that resource
func EventFields ¶
EventFields returns a set of fields that represent that resource
func EventFilterFields ¶
EventFilterFields returns a set of fields that represent that resource
func HandlerFields ¶
HandlerFields returns a set of fields that represent that resource
func HookConfigFields ¶
HookConfigFields returns a set of fields that represent that resource
func MergeMapWithPrefix ¶
MergeMapWithPrefix merges contents of one map into another using a prefix.
func MutatorFields ¶
MutatorFields returns a set of fields that represent that resource
func NamespaceFields ¶
NamespaceFields returns a set of fields that represent that resource
func PipelineFields ¶
PipelineFields returns a set of fields that represent that resource.
func RoleBindingFields ¶
RoleBindingFields returns a set of fields that represent that resource
func RoleFields ¶
RoleFields returns a set of fields that represent that resource
func SilencedFields ¶
SilencedFields returns a set of fields that represent that resource
func UserFields ¶
UserFields returns a set of fields that represent that resource
func V2EntityToV3 ¶
func V2EntityToV3(e *corev2.Entity) (*EntityConfig, *EntityState)
V2EntityToV3 converts a corev2.Entity to an EntityConfig and EntityState. The resulting values will contain pointers to e's memory.
func V3EntityToV2 ¶
func V3EntityToV2(cfg *EntityConfig, state *EntityState) (*corev2.Entity, error)
V3EntityToV2 converts an EntityConfig and an EntityState to a corev2.Entity. Errors are returned if cfg and state's Metadata are nil or not equal in terms of their namespace and name. The resulting object will contain pointers to cfg's and state's memory, and its metadata is carried over from the config.
func V3NamespaceToV2 ¶
func V3ToV2Resource ¶
func ValidateGlobalMetadata ¶
func ValidateGlobalMetadata(meta *corev2.ObjectMeta) error
func ValidateMetadata ¶
func ValidateMetadata(meta *corev2.ObjectMeta) error
Types ¶
type AuthProvider ¶
type AuthProvider interface { Resource // Authenticate attempts to authenticate a user with its username and password Authenticate(ctx context.Context, username, password string) (*corev2.Claims, error) // Refresh renews the user claims with the provider claims Refresh(ctx context.Context, claims *corev2.Claims) (*corev2.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 ClusterConfig ¶
type ClusterConfig struct {
Metadata *corev2.ObjectMeta
}
func (*ClusterConfig) GetMetadata ¶
func (c *ClusterConfig) GetMetadata() *corev2.ObjectMeta
func (*ClusterConfig) GetTypeMeta ¶
func (c *ClusterConfig) GetTypeMeta() corev2.TypeMeta
GetTypeMeta gets the type metadata for a ClusterConfig.
func (*ClusterConfig) RBACName ¶
func (c *ClusterConfig) RBACName() string
RBACName returns the RBAC name for ClusterConfig. It will be overridden if there is a method for ClusterConfig called "rbacName".
func (*ClusterConfig) SetMetadata ¶
func (c *ClusterConfig) SetMetadata(meta *corev2.ObjectMeta)
SetMetadata sets the provided metadata on the type. If the type does not have any metadata, nothing will happen.
func (*ClusterConfig) StoreName ¶
func (c *ClusterConfig) StoreName() string
StoreName returns the store name for ClusterConfig. It will be overridden if there is a method for ClusterConfig called "storeName".
func (*ClusterConfig) URIPath ¶
func (c *ClusterConfig) URIPath() string
URIPath returns the URI path for ClusterConfig. It will be overridden if there is a method for ClusterConfig called uriPath.
func (*ClusterConfig) UnmarshalJSON ¶
func (c *ClusterConfig) UnmarshalJSON(msg []byte) error
UnmarshalJSON is provided in order to ensure that metadata labels and annotations are never nil.
func (*ClusterConfig) Validate ¶
func (c *ClusterConfig) Validate() error
Validate validates the ClusterConfig. If the ClusterConfig has metadata, it will be validated via ValidateMetadata. If there is a method for ClusterConfig called validate, then it will be used to cooperatively validate the ClusterConfig.
type Deregistration ¶
type Deregistration = corev2.Deregistration
type EntityConfig ¶
type EntityConfig struct { // Metadata contains the name, namespace, labels and annotations of the // entity. Metadata *v2.ObjectMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` // EntityClass represents the class of the entity. It can be "agent", // "proxy", or "backend". EntityClass string `protobuf:"bytes,2,opt,name=entity_class,json=entityClass,proto3" json:"entity_class"` // User is the username the entity is connecting as, if the entity is an // agent entity. User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"` // Subscriptions are a weak relationship between entities and checks. The // scheduler uses subscriptions to make entities to checks when scheduling. Subscriptions []string `protobuf:"bytes,4,rep,name=subscriptions,proto3" json:"subscriptions"` // Deregister, if true, will result in the entity being deleted when the // entity is an agent, and the agent disconnects its session. Deregister bool `protobuf:"varint,5,opt,name=deregister,proto3" json:"deregister"` // Deregistration contains configuration for Sensu entity de-registration. Deregistration v2.Deregistration `protobuf:"bytes,6,opt,name=deregistration,proto3" json:"deregistration"` // KeepaliveHandlers contains a list of handlers to use for the entity's // keepalive events. KeepaliveHandlers []string `protobuf:"bytes,7,rep,name=keepalive_handlers,json=keepaliveHandlers,proto3" json:"keepalive_handlers,omitempty"` // Redact contains the fields to redact on the entity, if the entity is an] // agent entity. Redact []string `protobuf:"bytes,8,rep,name=redact,proto3" json:"redact,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
EntityConfig represents entity configuration.
func FixtureEntityConfig ¶
func FixtureEntityConfig(name string) *EntityConfig
func NewEntityConfig ¶
func NewEntityConfig(namespace, name string) *EntityConfig
NewEntityConfig creates a new EntityConfig.
func NewPopulatedEntityConfig ¶
func NewPopulatedEntityConfig(r randyEntityConfig, easy bool) *EntityConfig
func (*EntityConfig) Descriptor ¶
func (*EntityConfig) Descriptor() ([]byte, []int)
func (*EntityConfig) Equal ¶
func (this *EntityConfig) Equal(that interface{}) bool
func (*EntityConfig) Fields ¶
func (e *EntityConfig) Fields() map[string]string
func (*EntityConfig) GetDeregister ¶
func (m *EntityConfig) GetDeregister() bool
func (*EntityConfig) GetDeregistration ¶
func (m *EntityConfig) GetDeregistration() v2.Deregistration
func (*EntityConfig) GetEntityClass ¶
func (m *EntityConfig) GetEntityClass() string
func (*EntityConfig) GetKeepaliveHandlers ¶
func (m *EntityConfig) GetKeepaliveHandlers() []string
func (*EntityConfig) GetMetadata ¶
func (m *EntityConfig) GetMetadata() *v2.ObjectMeta
func (*EntityConfig) GetRedact ¶
func (m *EntityConfig) GetRedact() []string
func (*EntityConfig) GetSubscriptions ¶
func (m *EntityConfig) GetSubscriptions() []string
func (*EntityConfig) GetTypeMeta ¶
func (e *EntityConfig) GetTypeMeta() corev2.TypeMeta
GetTypeMeta gets the type metadata for a EntityConfig.
func (*EntityConfig) GetUser ¶
func (m *EntityConfig) GetUser() string
func (*EntityConfig) Marshal ¶
func (m *EntityConfig) Marshal() (dAtA []byte, err error)
func (*EntityConfig) MarshalToSizedBuffer ¶
func (m *EntityConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EntityConfig) ProduceRedacted ¶
func (e *EntityConfig) ProduceRedacted() Resource
ProduceRedacted redacts the entity according to the entity's Redact fields. A redacted copy is returned. The copy contains pointers to the original's memory, with different Labels and Annotations.
func (*EntityConfig) ProtoMessage ¶
func (*EntityConfig) ProtoMessage()
func (*EntityConfig) RBACName ¶
func (e *EntityConfig) RBACName() string
RBACName returns the RBAC name for EntityConfig. It will be overridden if there is a method for EntityConfig called "rbacName".
func (*EntityConfig) Reset ¶
func (m *EntityConfig) Reset()
func (*EntityConfig) SetMetadata ¶
func (e *EntityConfig) SetMetadata(meta *corev2.ObjectMeta)
SetMetadata sets the provided metadata on the type. If the type does not have any metadata, nothing will happen.
func (*EntityConfig) Size ¶
func (m *EntityConfig) Size() (n int)
func (*EntityConfig) StoreName ¶
func (e *EntityConfig) StoreName() string
StoreName returns the store name for EntityConfig. It will be overridden if there is a method for EntityConfig called "storeName".
func (*EntityConfig) String ¶
func (m *EntityConfig) String() string
func (*EntityConfig) URIPath ¶
func (e *EntityConfig) URIPath() string
URIPath returns the URI path for EntityConfig. It will be overridden if there is a method for EntityConfig called uriPath.
func (*EntityConfig) Unmarshal ¶
func (m *EntityConfig) Unmarshal(dAtA []byte) error
func (*EntityConfig) UnmarshalJSON ¶
func (e *EntityConfig) UnmarshalJSON(msg []byte) error
UnmarshalJSON is provided in order to ensure that metadata labels and annotations are never nil.
func (*EntityConfig) Validate ¶
func (e *EntityConfig) Validate() error
Validate validates the EntityConfig. If the EntityConfig has metadata, it will be validated via ValidateMetadata. If there is a method for EntityConfig called validate, then it will be used to cooperatively validate the EntityConfig.
func (*EntityConfig) XXX_DiscardUnknown ¶
func (m *EntityConfig) XXX_DiscardUnknown()
func (*EntityConfig) XXX_Marshal ¶
func (m *EntityConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EntityConfig) XXX_Merge ¶
func (m *EntityConfig) XXX_Merge(src proto.Message)
func (*EntityConfig) XXX_Size ¶
func (m *EntityConfig) XXX_Size() int
func (*EntityConfig) XXX_Unmarshal ¶
func (m *EntityConfig) XXX_Unmarshal(b []byte) error
type EntityState ¶
type EntityState struct { // Metadata contains the name, namespace, labels and annotations of the // entity. Metadata *v2.ObjectMeta `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` // System contains information about the system that the Agent process // is running on, used for additional Entity context. System v2.System `protobuf:"bytes,2,opt,name=system,proto3" json:"system"` // LastSeen is a unix timestamp that represents when the entity was last // observed by the keepalive system. LastSeen int64 `protobuf:"varint,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen"` // SensuAgentVersion is the sensu-agent version. SensuAgentVersion string `protobuf:"bytes,4,opt,name=sensu_agent_version,json=sensuAgentVersion,proto3" json:"sensu_agent_version"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
EntityState represents entity state. Unlike configuration, state is typically only maintained for agent entities, although it can be maintained for proxy entities in certain circumstances.
func FixtureEntityState ¶
func FixtureEntityState(name string) *EntityState
func NewEntityState ¶
func NewEntityState(namespace, name string) *EntityState
NewEntityState creates a new EntityState.
func NewPopulatedEntityState ¶
func NewPopulatedEntityState(r randyEntityState, easy bool) *EntityState
func (*EntityState) Descriptor ¶
func (*EntityState) Descriptor() ([]byte, []int)
func (*EntityState) Equal ¶
func (this *EntityState) Equal(that interface{}) bool
func (*EntityState) Fields ¶
func (e *EntityState) Fields() map[string]string
func (*EntityState) GetLastSeen ¶
func (m *EntityState) GetLastSeen() int64
func (*EntityState) GetMetadata ¶
func (m *EntityState) GetMetadata() *v2.ObjectMeta
func (*EntityState) GetSensuAgentVersion ¶
func (m *EntityState) GetSensuAgentVersion() string
func (*EntityState) GetSystem ¶
func (m *EntityState) GetSystem() v2.System
func (*EntityState) GetTypeMeta ¶
func (e *EntityState) GetTypeMeta() corev2.TypeMeta
GetTypeMeta gets the type metadata for a EntityState.
func (*EntityState) Marshal ¶
func (m *EntityState) Marshal() (dAtA []byte, err error)
func (*EntityState) MarshalToSizedBuffer ¶
func (m *EntityState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EntityState) ProtoMessage ¶
func (*EntityState) ProtoMessage()
func (*EntityState) RBACName ¶
func (e *EntityState) RBACName() string
RBACName returns the RBAC name for EntityState. It will be overridden if there is a method for EntityState called "rbacName".
func (*EntityState) Reset ¶
func (m *EntityState) Reset()
func (*EntityState) SetMetadata ¶
func (e *EntityState) SetMetadata(meta *corev2.ObjectMeta)
SetMetadata sets the provided metadata on the type. If the type does not have any metadata, nothing will happen.
func (*EntityState) Size ¶
func (m *EntityState) Size() (n int)
func (*EntityState) StoreName ¶
func (e *EntityState) StoreName() string
StoreName returns the store name for EntityState. It will be overridden if there is a method for EntityState called "storeName".
func (*EntityState) String ¶
func (m *EntityState) String() string
func (*EntityState) URIPath ¶
func (e *EntityState) URIPath() string
URIPath returns the URI path for EntityState. It will be overridden if there is a method for EntityState called uriPath.
func (*EntityState) Unmarshal ¶
func (m *EntityState) Unmarshal(dAtA []byte) error
func (*EntityState) UnmarshalJSON ¶
func (e *EntityState) UnmarshalJSON(msg []byte) error
UnmarshalJSON is provided in order to ensure that metadata labels and annotations are never nil.
func (*EntityState) Validate ¶
func (e *EntityState) Validate() error
Validate validates the EntityState. If the EntityState has metadata, it will be validated via ValidateMetadata. If there is a method for EntityState called validate, then it will be used to cooperatively validate the EntityState.
func (*EntityState) XXX_DiscardUnknown ¶
func (m *EntityState) XXX_DiscardUnknown()
func (*EntityState) XXX_Marshal ¶
func (m *EntityState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EntityState) XXX_Merge ¶
func (m *EntityState) XXX_Merge(src proto.Message)
func (*EntityState) XXX_Size ¶
func (m *EntityState) XXX_Size() int
func (*EntityState) XXX_Unmarshal ¶
func (m *EntityState) XXX_Unmarshal(b []byte) error
type Fielder ¶
type Fielder interface { // Fields returns a set of fields that represent the resource. Fields() map[string]string }
Fielder includes a set of fields that represent a resource.
type GeneratedType ¶
type GeneratedType interface { // SetMetadata sets metadata on its receiver, if the receiver has metadata // to set. If the receiver does not have metadata to set, nothing happens. SetMetadata(*corev2.ObjectMeta) // StoreName gives the name of the resource as it pertains to a store. StoreName() string // RBACName describes the name of the resource for RBAC purposes. RBACName() string // URIPath gives the path to the resource, e.g. /checks/checkname URIPath() string // Validate checks if the fields in the resource are valid. Validate() error }
GeneratedType is an interface that specifies all the methods that are automatically generated.
type GlobalResource ¶
type GlobalResource interface { // IsGlobalResource returns true when the resource // is not namespaced. IsGlobalResource() bool }
GlobalResource is an interface for indicating a resource's namespace strategy
type Namespace ¶
type Namespace struct {
Metadata *corev2.ObjectMeta `json:"metadata"`
}
Namespace resource contains standard resource object metadata for a given namespace.
func FixtureNamespace ¶
func NewNamespace ¶
func V2NamespaceToV3 ¶
func (*Namespace) GetMetadata ¶
func (n *Namespace) GetMetadata() *corev2.ObjectMeta
func (*Namespace) GetTypeMeta ¶
GetTypeMeta gets the type metadata for a Namespace.
func (*Namespace) IsGlobalResource ¶
func (*Namespace) RBACName ¶
RBACName returns the RBAC name for Namespace. It will be overridden if there is a method for Namespace called "rbacName".
func (*Namespace) SetMetadata ¶
func (n *Namespace) SetMetadata(meta *corev2.ObjectMeta)
SetMetadata sets the provided metadata on the type. If the type does not have any metadata, nothing will happen.
func (*Namespace) StoreName ¶
StoreName returns the store name for Namespace. It will be overridden if there is a method for Namespace called "storeName".
func (*Namespace) URIPath ¶
URIPath returns the URI path for Namespace. It will be overridden if there is a method for Namespace called uriPath.
func (*Namespace) UnmarshalJSON ¶
UnmarshalJSON is provided in order to ensure that metadata labels and annotations are never nil.
type NetworkInterface ¶
type NetworkInterface = corev2.NetworkInterface
type Redacter ¶
type Redacter interface { // ProduceRedacted returns a redacted copy of the resource ProduceRedacted() Resource }
Redacter can return a redacted copy of the resource
type Resource ¶
type Resource interface { // GetMetadata returns the object metadata for the resource. GetMetadata() *corev2.ObjectMeta GeneratedType }
Resource represents a Sensu resource.
type ResourceTemplate ¶
type ResourceTemplate struct { Metadata *corev2.ObjectMeta `json:"metadata"` APIVersion string `json:"api_version"` Type string `json:"type"` Template string `json:"template"` }
ResourceTemplate is a template for core/v3 resources.
func (*ResourceTemplate) Execute ¶
func (r *ResourceTemplate) Execute(meta *corev2.ObjectMeta) (Resource, error)
Execute executes the Template in the ResourceTemplate. It's given a metadata object to draw variables from. Typically, templating will be done with a variable namespace or name, but could also be done with labels and annotations from the metadata, depending on the nature of the template.
func (*ResourceTemplate) GetMetadata ¶
func (r *ResourceTemplate) GetMetadata() *corev2.ObjectMeta
func (*ResourceTemplate) GetTypeMeta ¶
func (r *ResourceTemplate) GetTypeMeta() corev2.TypeMeta
GetTypeMeta gets the type metadata for a ResourceTemplate.
func (*ResourceTemplate) RBACName ¶
func (r *ResourceTemplate) RBACName() string
RBACName returns the RBAC name for ResourceTemplate. It will be overridden if there is a method for ResourceTemplate called "rbacName".
func (*ResourceTemplate) SetMetadata ¶
func (r *ResourceTemplate) SetMetadata(meta *corev2.ObjectMeta)
SetMetadata sets the provided metadata on the type. If the type does not have any metadata, nothing will happen.
func (*ResourceTemplate) StoreName ¶
func (r *ResourceTemplate) StoreName() string
StoreName returns the store name for ResourceTemplate. It will be overridden if there is a method for ResourceTemplate called "storeName".
func (*ResourceTemplate) URIPath ¶
func (r *ResourceTemplate) URIPath() string
URIPath returns the URI path for ResourceTemplate. It will be overridden if there is a method for ResourceTemplate called uriPath.
func (*ResourceTemplate) UnmarshalJSON ¶
func (r *ResourceTemplate) UnmarshalJSON(msg []byte) error
UnmarshalJSON is provided in order to ensure that metadata labels and annotations are never nil.
func (*ResourceTemplate) Validate ¶
func (r *ResourceTemplate) Validate() error
Validate validates the ResourceTemplate. If the ResourceTemplate has metadata, it will be validated via ValidateMetadata. If there is a method for ResourceTemplate called validate, then it will be used to cooperatively validate the ResourceTemplate.
type SymmetricKey ¶
type SymmetricKey struct { Metadata *corev2.ObjectMeta `json:"metadata"` Value []byte `json:"value"` }
func (*SymmetricKey) GetMetadata ¶
func (s *SymmetricKey) GetMetadata() *corev2.ObjectMeta
func (*SymmetricKey) GetTypeMeta ¶
func (s *SymmetricKey) GetTypeMeta() corev2.TypeMeta
GetTypeMeta gets the type metadata for a SymmetricKey.
func (*SymmetricKey) RBACName ¶
func (s *SymmetricKey) RBACName() string
RBACName returns the RBAC name for SymmetricKey. It will be overridden if there is a method for SymmetricKey called "rbacName".
func (*SymmetricKey) SetMetadata ¶
func (s *SymmetricKey) SetMetadata(meta *corev2.ObjectMeta)
SetMetadata sets the provided metadata on the type. If the type does not have any metadata, nothing will happen.
func (*SymmetricKey) StoreName ¶
func (s *SymmetricKey) StoreName() string
StoreName returns the store name for SymmetricKey. It will be overridden if there is a method for SymmetricKey called "storeName".
func (*SymmetricKey) URIPath ¶
func (s *SymmetricKey) URIPath() string
URIPath returns the URI path for SymmetricKey. It will be overridden if there is a method for SymmetricKey called uriPath.
func (*SymmetricKey) UnmarshalJSON ¶
func (s *SymmetricKey) UnmarshalJSON(msg []byte) error
UnmarshalJSON is provided in order to ensure that metadata labels and annotations are never nil.
func (*SymmetricKey) Validate ¶
func (s *SymmetricKey) Validate() error
Validate validates the SymmetricKey. If the SymmetricKey has metadata, it will be validated via ValidateMetadata. If there is a method for SymmetricKey called validate, then it will be used to cooperatively validate the SymmetricKey.
type V2ResourceProxy ¶
type V2ResourceProxy struct {
Resource
}
V2ResourceProxy is a compatibility shim for converting from a v3 resource to a v2 resource.
func (*V2ResourceProxy) GetObjectMeta ¶
func (v *V2ResourceProxy) GetObjectMeta() corev2.ObjectMeta
func (V2ResourceProxy) GetTypeMeta ¶
func (v V2ResourceProxy) GetTypeMeta() corev2.TypeMeta
func (V2ResourceProxy) MarshalJSON ¶
func (v V2ResourceProxy) MarshalJSON() ([]byte, error)
func (*V2ResourceProxy) SetNamespace ¶
func (v *V2ResourceProxy) SetNamespace(ns string)
func (*V2ResourceProxy) SetObjectMeta ¶
func (v *V2ResourceProxy) SetObjectMeta(meta corev2.ObjectMeta)
func (*V2ResourceProxy) StorePrefix ¶
func (v *V2ResourceProxy) StorePrefix() string
func (*V2ResourceProxy) UnmarshalJSON ¶
func (v *V2ResourceProxy) UnmarshalJSON(b []byte) error