README
¶
Example xDS Server: go-control-plane
This is an example of a trivial xDS V3 control plane server, that uses envoy's go control plane. It implements the xds-test-harness adapter for setting and updating the server state. It is not meant as an actual envoy control plane, and maintains just a simple snapshot state.
To run it, from the root of this repo, invoke:
go run examples/go-control-plane/main.go
Once it is running, you can run the test suite in a separate window with:
go run .
Files
- main/main.go is the example program entrypoint. It instantiates the cache and xDS server and runs the xDS server process.
- adapter.go implementation of the adapter api.
- server.go runs the xDS control plane server.
- logger.go implements the
pkg/log/Logger
interface which provides logging services to the cache.
Documentation
¶
Overview ¶
Copyright 2020 Envoyproxy Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Envoyproxy Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func MakeCluster(clusterName string, node string) *cluster.Cluster
- func MakeEndpoint(clusterName string, address string, port uint32) *endpoint.ClusterLoadAssignment
- func MakeRoute(routeName, clusterName string) *route.RouteConfiguration
- func MakeRouteHTTPListener(clusterName string, listenerName string, listenerAddress string, port uint32, ...) *listener.Listener
- func MakeRuntime(runtimeName string) *runtime.Runtime
- func RunAdapter(port uint, cache cache.SnapshotCache)
- func RunServer(ctx context.Context, srv server.Server, port uint)
- type Clusters
- type Endpoints
- type Listeners
- type Logger
Constants ¶
const ( TypeUrlLDS = "type.googleapis.com/envoy.config.listener.v3.Listener" TypeUrlCDS = "type.googleapis.com/envoy.config.cluster.v3.Cluster" TypeUrlRDS = "type.googleapis.com/envoy.config.route.v3.RouteConfiguration" TypeUrlEDS = "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment" )
Variables ¶
This section is empty.
Functions ¶
func MakeEndpoint ¶
func MakeEndpoint(clusterName string, address string, port uint32) *endpoint.ClusterLoadAssignment
MakeEndpoint creates a localhost endpoint on a given port.
func MakeRoute ¶
func MakeRoute(routeName, clusterName string) *route.RouteConfiguration
func MakeRouteHTTPListener ¶
func MakeRuntime ¶
MakeRuntime creates an RTDS layer with some fields.
func RunAdapter ¶
func RunAdapter(port uint, cache cache.SnapshotCache)
Types ¶
type Endpoints ¶
type Endpoints map[string]*endpoint.ClusterLoadAssignment
type Logger ¶
type Logger struct {
Debug bool
}
An example of a logger that implements `pkg/log/Logger`. Logs to stdout. If Debug == false then Debugf() and Infof() won't output anything.