istio: istio.io/istio/galley/pkg/runtime/resource Index | Files

package resource

import "istio.io/istio/galley/pkg/runtime/resource"

Package resource contains core abstract types for representing configuration resources.

Index

Package Files

event.go proto.go resource.go schema.go

Variables

var (
    // FullSyncEvent is a special event representing a FullSync.
    FullSyncEvent = Event{Kind: FullSync}
)

type Annotations Uses

type Annotations map[string]string

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 Uses

type Collection struct {
    // contains filtered or unexported fields
}

Collection of the resource.

func (Collection) String Uses

func (t Collection) String() string

String interface method implementation.

type Entry Uses

type Entry struct {
    Metadata Metadata
    ID       VersionedKey
    Item     proto.Message
}

Entry is the abstract representation of a versioned config resource in Istio.

func (*Entry) IsEmpty Uses

func (r *Entry) IsEmpty() bool

IsEmpty returns true if the resource Entry.Item is nil.

type Event Uses

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.

func (Event) String Uses

func (e Event) String() string

String implements Stringer.String

type EventHandler Uses

type EventHandler func(event Event)

EventHandler function.

type EventKind Uses

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
)

func (EventKind) String Uses

func (k EventKind) String() string

String implements Stringer.String

type FullName Uses

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 Uses

func FullNameFromNamespaceAndName(namespace, name string) FullName

FullNameFromNamespaceAndName returns a FullName from namespace and name.

func (FullName) InterpretAsNamespaceAndName Uses

func (n FullName) InterpretAsNamespaceAndName() (string, string)

InterpretAsNamespaceAndName tries to split the name as namespace and name

func (FullName) String Uses

func (n FullName) String() string

String inteface implementation.

type Info Uses

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 Uses

func (i *Info) NewProtoInstance() proto.Message

NewProtoInstance returns a new instance of the underlying proto for this resource.

func (*Info) String Uses

func (i *Info) String() string

String interface method implementation.

type Key Uses

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.

func (Key) String Uses

func (k Key) String() string

String interface method implementation.

type Labels Uses

type Labels map[string]string

Labels are a map of string keys and values that can be used to organize and categorize resources within a collection.

type Metadata Uses

type Metadata struct {
    CreateTime  time.Time
    Labels      Labels
    Annotations Annotations
}

type Schema Uses

type Schema struct {
    // contains filtered or unexported fields
}

Schema contains metadata about configuration resources.

func (*Schema) All Uses

func (s *Schema) All() []Info

All returns all known info objects

func (*Schema) Collections Uses

func (s *Schema) Collections() []string

Collections returns all known collections.

func (*Schema) Get Uses

func (s *Schema) Get(collection string) Info

Get looks up a resource.Info by its collection. Panics if it is not found.

func (*Schema) Lookup Uses

func (s *Schema) Lookup(collection string) (Info, bool)

Lookup looks up a resource.Info by its collection.

type SchemaBuilder Uses

type SchemaBuilder struct {
    // contains filtered or unexported fields
}

SchemaBuilder is a buidler for the schema type.

func NewSchemaBuilder Uses

func NewSchemaBuilder() *SchemaBuilder

NewSchemaBuilder returns a new instance of SchemaBuilder.

func (*SchemaBuilder) Build Uses

func (b *SchemaBuilder) Build() *Schema

Build a new schema from this SchemaBuilder.

func (*SchemaBuilder) Register Uses

func (b *SchemaBuilder) Register(rawCollection, rawTypeURL string) Info

Register a proto into the schema.

func (*SchemaBuilder) RegisterInfo Uses

func (b *SchemaBuilder) RegisterInfo(info Info) *SchemaBuilder

Register a proto into the schema.

func (*SchemaBuilder) RegisterSchema Uses

func (b *SchemaBuilder) RegisterSchema(schema *Schema) *SchemaBuilder

Register all protos in the given Schema

func (*SchemaBuilder) UnregisterInfo Uses

func (b *SchemaBuilder) UnregisterInfo(info Info) *SchemaBuilder

Unregister a proto from the schema.

func (*SchemaBuilder) UnregisterSchema Uses

func (b *SchemaBuilder) UnregisterSchema(schema *Schema) *SchemaBuilder

Unregister all protos in the given Schema

type TypeURL Uses

type TypeURL struct {
    // contains filtered or unexported fields
}

TypeURL of the resource.

func (TypeURL) MessageName Uses

func (t TypeURL) MessageName() string

MessageName portion of the type URL.

func (TypeURL) String Uses

func (t TypeURL) String() string

String interface method implementation.

type Version Uses

type Version string

Version is the version identifier of a resource.

type VersionedKey Uses

type VersionedKey struct {
    Key
    Version Version
}

VersionedKey uniquely identifies a snapshot of a config resource in the config space.

func (VersionedKey) String Uses

func (k VersionedKey) String() string

String interface method implementation.

Package resource imports 6 packages (graph) and is imported by 22 packages. Updated 2019-03-27. Refresh now. Tools for package owners.