example

package module
v0.0.0-...-28b1629 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Example Rate-limit Configuration SotW xDS Server

This is an example of a trivial xDS V3 control plane server similar to the example server in go-control-plane. It serves sample Rate limit configuration. You can run the example using the project top-level docker-compose-example.yml, e.g.:

export CONFIG_TYPE=GRPC_XDS_SOTW
docker-compose -f docker-compose-example.yml --profile xds-config up --build --remove-orphans

The docker-compose builds and runs the example server along with Rate limit server. The example server serves a configuration defined in resource.go. If everything works correctly, you can follow the examples in project top-level README.md file.

Files

  • main/main.go is the example program entrypoint. It instantiates the cache and xDS server and runs the xDS server process.
  • resource.go generates a Snapshot structure which describes the configuration that the xDS server serves to Envoy.
  • server.go runs the xDS control plane server.
  • logger.go is the logger.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSnapshot

func GenerateSnapshot() *cache.Snapshot

func RunServer

func RunServer(ctx context.Context, srv server.Server, port uint)

RunServer starts an xDS server at the given port.

Types

type Logger

type Logger struct {
	Debug bool
}

func (Logger) Debugf

func (logger Logger) Debugf(format string, args ...interface{})

func (Logger) Errorf

func (logger Logger) Errorf(format string, args ...interface{})

func (Logger) Infof

func (logger Logger) Infof(format string, args ...interface{})

func (Logger) Warnf

func (logger Logger) Warnf(format string, args ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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