kubernetes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceName defines the name of the third party resource in kubernetes
	ResourceName = "routing-rule"
	// ResourceKind defines the kind of the third party resource in kubernetes
	ResourceKind = "RoutingRule"
	// ResourceGroupName defines the group name of the third party resource in kubernetes
	ResourceGroupName = "amalgam8.io"
	// ResourceVersion defines the version of the third party resource in kubernetes
	ResourceVersion = "v1"
	// ResourceDescription defines the description of the third party resource in kubernetes
	ResourceDescription = "A specification of an Amalgam8 rule resource"
	// RuleStateValid defines the state of a valid rule resource
	RuleStateValid = "valid"
	// RuleStateInvalid defines the state of an invalid rule resource
	RuleStateInvalid = "invalid"
)
View Source
const (
	// RulesCacheResyncPeriod is the period in which we do a full resync of the Rules cache.
	RulesCacheResyncPeriod = time.Duration(60) * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter for Kubernetes Service Discovery.

func New

func New(config Config) (*Adapter, error)

New creates and starts a new Kubernetes Rules adapter.

func (*Adapter) ListRules

func (a *Adapter) ListRules(f *a8api.RuleFilter) (*a8api.RulesSet, error)

ListRules queries for the list of rules currently exist.

func (*Adapter) Start

func (a *Adapter) Start() error

Start synchronizing the Kubernetes adapter.

func (*Adapter) Stop

func (a *Adapter) Stop() error

Stop synchronizing the Kubernetes adapter.

type Config

type Config struct {
	URL       string
	Token     string
	Namespace auth.Namespace
}

Config stores configurable attributes of the Kubernetes adapter.

type RoutingRule

type RoutingRule struct {
	unversioned.TypeMeta `json:",inline"`
	Metadata             api.ObjectMeta `json:"metadata"`

	Spec   a8api.Rule `json:"spec,omitempty"`
	Status StatusSpec `json:"status,omitempty"`
}

RoutingRule defines the third party resource spec

func (*RoutingRule) GetObjectKind

func (r *RoutingRule) GetObjectKind() unversioned.ObjectKind

GetObjectKind - Required to satisfy Object interface

func (*RoutingRule) GetObjectMeta

func (r *RoutingRule) GetObjectMeta() meta.Object

GetObjectMeta - Required to satisfy ObjectMetaAccessor interface

func (*RoutingRule) UnmarshalJSON

func (r *RoutingRule) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the JSON-encoded data and stores the result in the value pointed to by r

type RoutingRuleList

type RoutingRuleList struct {
	unversioned.TypeMeta `json:",inline"`
	Metadata             unversioned.ListMeta `json:"metadata"`

	Items []RoutingRule `json:"items"`
}

RoutingRuleList defines list of rules

func (*RoutingRuleList) GetListMeta

func (rl *RoutingRuleList) GetListMeta() unversioned.List

GetListMeta - Required to satisfy ListMetaAccessor interface

func (*RoutingRuleList) GetObjectKind

func (rl *RoutingRuleList) GetObjectKind() unversioned.ObjectKind

GetObjectKind - Required to satisfy Object interface

func (*RoutingRuleList) UnmarshalJSON

func (rl *RoutingRuleList) UnmarshalJSON(data []byte) error

UnmarshalJSON parses the JSON-encoded data and stores the result in the value pointed to by rl

type RuleCopy

type RuleCopy RoutingRule

RuleCopy defines a rule resource

type RuleListCopy

type RuleListCopy RoutingRuleList

RuleListCopy defines list of rules

type StatusSpec

type StatusSpec struct {
	State   string `json:"state,omitempty"`
	Message string `json:"message,omitempty"`
}

StatusSpec defines third party resource status

Jump to

Keyboard shortcuts

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