Documentation ¶
Overview ¶
Package resource contains core abstract types for representing configuration resources.
Index ¶
- Variables
- type Annotations
- type Collection
- type Entry
- type Event
- type EventHandler
- type EventKind
- type FullName
- type Info
- type Key
- type Labels
- type Metadata
- type Schema
- type SchemaBuilder
- func (b *SchemaBuilder) Build() *Schema
- func (b *SchemaBuilder) Register(rawCollection, rawTypeURL string) Info
- func (b *SchemaBuilder) RegisterInfo(info Info) *SchemaBuilder
- func (b *SchemaBuilder) RegisterSchema(schema *Schema) *SchemaBuilder
- func (b *SchemaBuilder) UnregisterInfo(info Info) *SchemaBuilder
- func (b *SchemaBuilder) UnregisterSchema(schema *Schema) *SchemaBuilder
- type TypeURL
- type Version
- type VersionedKey
Constants ¶
This section is empty.
Variables ¶
var ( // FullSyncEvent is a special event representing a FullSync. FullSyncEvent = Event{Kind: FullSync} )
Functions ¶
This section is empty.
Types ¶
type Annotations ¶
Annotations are a map of string keys and values that can be used by source and sink to communicate arbitrary metadata about this resource.
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection of the resource.
func (Collection) String ¶
func (t Collection) String() string
String interface method implementation.
type Entry ¶
type Entry struct { Metadata Metadata ID VersionedKey Item proto.Message }
Entry is the abstract representation of a versioned config resource in Istio.
type Event ¶
type Event struct { Kind EventKind // A single entry, in case the event is Added, Updated or Deleted. Entry Entry }
Event represents a change that occurred against a resource in the source config system.
type EventKind ¶
type EventKind int
EventKind is the type of an event.
const ( // None is a sentinel value. Should not be used. None EventKind = iota // Added indicates that a new resource has been added. Added // Updated indicates that an existing resource has been updated. Updated // Deleted indicates an existing resource has been deleted. Deleted // FullSync indicates that the initial state of the store has been published as a series of Added events. // Events after FullSync are actual change events that the source-store has encountered. FullSync )
type FullName ¶
type FullName struct {
// contains filtered or unexported fields
}
FullName of the resource. It is unique within a given set of resource of the same collection.
func FullNameFromNamespaceAndName ¶
FullNameFromNamespaceAndName returns a FullName from namespace and name.
func (FullName) InterpretAsNamespaceAndName ¶
InterpretAsNamespaceAndName tries to split the name as namespace and name
type Info ¶
type Info struct { // Collection of the resource that this info is about Collection Collection TypeURL TypeURL // contains filtered or unexported fields }
Info is the type metadata for an Entry.
func (*Info) NewProtoInstance ¶
NewProtoInstance returns a new instance of the underlying proto for this resource.
type Key ¶
type Key struct { // Collection of the resource. Collection Collection // Fully qualified name of the resource. FullName FullName }
Key uniquely identifies a (mutable) config resource in the config space.
type Labels ¶
Labels are a map of string keys and values that can be used to organize and categorize resources within a collection.
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema contains metadata about configuration resources.
func (*Schema) Collections ¶
Collections returns all known collections.
type SchemaBuilder ¶
type SchemaBuilder struct {
// contains filtered or unexported fields
}
SchemaBuilder is a buidler for the schema type.
func NewSchemaBuilder ¶
func NewSchemaBuilder() *SchemaBuilder
NewSchemaBuilder returns a new instance of SchemaBuilder.
func (*SchemaBuilder) Build ¶
func (b *SchemaBuilder) Build() *Schema
Build a new schema from this SchemaBuilder.
func (*SchemaBuilder) Register ¶
func (b *SchemaBuilder) Register(rawCollection, rawTypeURL string) Info
Register a proto into the schema.
func (*SchemaBuilder) RegisterInfo ¶
func (b *SchemaBuilder) RegisterInfo(info Info) *SchemaBuilder
Register a proto into the schema.
func (*SchemaBuilder) RegisterSchema ¶
func (b *SchemaBuilder) RegisterSchema(schema *Schema) *SchemaBuilder
Register all protos in the given Schema
func (*SchemaBuilder) UnregisterInfo ¶
func (b *SchemaBuilder) UnregisterInfo(info Info) *SchemaBuilder
Unregister a proto from the schema.
func (*SchemaBuilder) UnregisterSchema ¶
func (b *SchemaBuilder) UnregisterSchema(schema *Schema) *SchemaBuilder
Unregister all protos in the given Schema
type TypeURL ¶
type TypeURL struct {
// contains filtered or unexported fields
}
TypeURL of the resource.
func (TypeURL) MessageName ¶
MessageName portion of the type URL.
type VersionedKey ¶
VersionedKey uniquely identifies a snapshot of a config resource in the config space.
func (VersionedKey) String ¶
func (k VersionedKey) String() string
String interface method implementation.