parser

package
v0.0.0-...-1bdd90c Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClusterSubSetNotFound by name
	ErrClusterSubSetNotFound = errors.New("cannot found cluster subset")
)

Functions

This section is empty.

Types

type API

type API struct {
	metapb.API

	Namespace string
	// Proxies key: clusterName, value: Proxy
	Proxies  map[string]Proxy
	HTTPRule configurationv1beta1.ManbaHTTPRule
	Routings []Routing
}

API contains manba API

type Cluster

type Cluster struct {
	metapb.Cluster

	Servers   []*Server
	Port      string
	Namespace string
	K8SSbuSet configurationv1beta1.ManbaClusterSubSet
}

Cluster containers k8s service and manba cluster

type ManbaState

type ManbaState struct {
	APIs     []API
	Servers  []Server
	Clusters []Cluster
	Routings []Routing
	Plugins  []Plugin
}

ManbaState holds the configuration that should be applied to Manba.

type Parser

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

Parser parses Kubernetes CRDs and Ingress rules and generates a Manba configuration.

func New

func New(s store.Store) *Parser

New returns a new parser backed with store.

func (*Parser) Build

func (p *Parser) Build() (*ManbaState, error)

Build creates a Manba configuration from Ingress and Custom resources defined in Kuberentes. It throws an error if there is an error returned from client-go.

type Plugin

type Plugin struct {
	// metapb.Plugin
	Name string
}

Plugin implements manba Plugin

type Proxy

type Proxy struct {
	ClusterName string
	metapb.DispatchNode
}

Proxy implements manba DispatchNode

type Routing

type Routing struct {
	APIName     string
	ClusterName string
	metapb.Routing
}

Routing represents a Manba Routing and holds a reference to the Ingress rule.

type Server

type Server struct {
	metapb.Server
}

Server contains k8s endpoint and manba server

type Service

type Service struct {
	Cluster *Cluster
	Servers []*Server

	APIs []*API

	Namespace string
	Backend   configurationv1beta1.ManbaCluster
}

Service contains k8s service and manba cluster

Jump to

Keyboard shortcuts

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