resource

package
v0.0.0-...-48a44ca Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package resource contains core abstract types for representing configuration resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID   VersionedKey
	Item proto.Message
}

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

func (*Entry) IsEmpty

func (r *Entry) IsEmpty() bool

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

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.

func (Event) String

func (e Event) String() string

String implements Stringer.String

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
)

func (EventKind) String

func (k EventKind) String() string

String implements Stringer.String

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 TypeUrl.

func FullNameFromNamespaceAndName

func FullNameFromNamespaceAndName(namespace, name string) FullName

FullNameFromNamespaceAndName returns a FullName from namespace and name.

func (FullName) InterpretAsNamespaceAndName

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

InterpretAsNamespaceAndName tries to split the name as namespace and name

func (FullName) String

func (n FullName) String() string

String inteface implementation.

type Info

type Info struct {
	// TypeURL of the resource that this info is about
	TypeURL TypeURL
	// contains filtered or unexported fields
}

Info is the type metadata for an Entry.

func (*Info) NewProtoInstance

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

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

func (*Info) String

func (i *Info) String() string

String interface method implementation.

type Key

type Key struct {
	// TypeURL of the resource.
	TypeURL TypeURL

	// Fully qualified name of the resource.
	FullName FullName
}

Key uniquely identifies a (mutable) config resource in the config space.

func (Key) String

func (k Key) String() string

String interface method implementation.

type Schema

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

Schema contains metadata about configuration resources.

func (*Schema) All

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

All returns all known info objects

func (*Schema) Get

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

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

func (*Schema) Lookup

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

Lookup looks up a resource.Info by its type url.

func (*Schema) TypeURLs

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

TypeURLs returns all known type URLs.

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(typeURL string) Info

Register a proto into the schema.

type TypeURL

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

TypeURL of the resource.

func (TypeURL) MessageName

func (t TypeURL) MessageName() string

MessageName portion of the type URL.

func (TypeURL) String

func (t TypeURL) String() string

String interface method implementation.

type Version

type Version string

Version is the version identifier of a resource.

type VersionedKey

type VersionedKey struct {
	Key
	Version    Version
	CreateTime time.Time
}

VersionedKey uniquely identifies a snapshot of a config resource in the config space, at a given time.

func (VersionedKey) String

func (k VersionedKey) String() string

String interface method implementation.

Jump to

Keyboard shortcuts

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