proxyconfigmap

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProxyConfigMapCreateReason       = "MemcachedProxyConfigMapCreated"
	FailedProxyConfigMapCreateReason = "MemcachedProxyConfigMapCreateError"
	FailedProxyConfigMapUpdateReason = "MemcachedProxyConfigMapUpdateError"
	DeleteConfigMapReason            = "MemcachedProxyConfigMapDelete"
)

Variables

View Source
var (
	KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)

Functions

This section is empty.

Types

type Controller

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

Cotroller represents a memcached proxy config map controller that watches MemcachedProxy objects and creates a ConfigMap used to configure mcrouter.

func New

func New(
	name string,
	client clientset.Interface,
	ianlewisorgClient ianlewisorgclientset.Interface,
	namespace string,
	proxyInformer cache.SharedIndexInformer,
	configMapInformer cache.SharedIndexInformer,
	serviceInformer cache.SharedIndexInformer,
	endpointsInformer cache.SharedIndexInformer,
	recorder record.EventRecorder,
	logger *logging.Logger,
	workers int,
) *Controller

New creates a new memcached proxy configmap controller

func (*Controller) Run

func (c *Controller) Run(ctx context.Context) error

type McRouterConfig

type McRouterConfig struct {
	Pools map[string]Pool `json:"pools,omitempty"`
	Route StringOrRoute   `json:"route,omitempty"`
}

McRouterConfig represents JSON configuration for mcrouter.

type OperationPolicies

type OperationPolicies struct {
	Add    *StringOrRoute `json:"add,omitempty"`
	Set    *StringOrRoute `json:"set,omitempty"`
	Delete *StringOrRoute `json:"delete,omitempty"`
	Get    *StringOrRoute `json:"empty,omitempty"`
}

OperationPolicies configures operation policies for different actions via mcrouter

type Pool

type Pool struct {
	Servers []string `json:"servers"`
}

Pool is a memcached server pool

type Route

type Route struct {
	Type              string             `json:"type"`
	DefaultPolicy     *StringOrRoute     `json:"default_policy,omitempty"`
	OperationPolicies *OperationPolicies `json:"operation_policies,omitempty"`
	Children          []StringOrRoute    `json:"children,omitempty"`
}

Route is the object version of a mcrouter route

type StringOrRoute

type StringOrRoute struct {
	Route     *Route
	StringVal string
}

StringOrRoute describes an mcrouter route. It can be either an object or a string.

func (StringOrRoute) MarshalJSON

func (r StringOrRoute) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

Jump to

Keyboard shortcuts

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